Skip to content
Other

Law of Cosines Triangle Calculator

Use the Law of Cosines to solve any triangle when you know three sides (SSS) or two sides and the angle between them (SAS). Enter your known values, choose your angle unit and length unit, and get all remaining sides, all angles, area, perimeter, inradius, and circumradius instantly. A step-by-step panel shows every calculation with your actual numbers.

Your details

SSS: provide all three sides. SAS: provide sides a and b and their included angle C.
Length of side a (opposite angle A).
m
Length of side b (opposite angle B).
m
Length of side c (opposite angle C). Leave as-is for SAS mode (will be computed).
AreaAcute triangle
17.3205

Triangle's surface area (Heron's formula).

Angle A60
Angle B81.7868
Angle C38.2132
Perimeter20
Semi-perimeter10
Inradius1.7321
Circumradius4.0415
Triangle typescalene, acute

Triangle solved: scalene, acute.

  • The three angles are 60.0000 deg, 81.7868 deg, and 38.2132 deg - they sum to 180.0000 as expected.
  • Area is 17.3205 m², perimeter is 20.0000 m.
  • The inscribed circle has radius 1.7321 m; the circumscribed circle has radius 4.0415 m.

Next stepTo cross-check, you can use the Law of Sines: a / sin(A) = b / sin(B) = c / sin(C). All three ratios should be equal.

What is the Law of Cosines?

The Law of Cosines generalises the Pythagorean theorem to any triangle, not just right-angled ones. The three forms of the formula are: a² = b² + c² - 2bc cos(A), b² = a² + c² - 2ac cos(B), and c² = a² + b² - 2ab cos(C). When angle C equals 90°, cos(C) = 0 and the third formula reduces to the familiar c² = a² + b², confirming that the Pythagorean theorem is a special case. The law also lets you recover any angle from three sides using the inverse cosine: A = arccos[(b² + c² - a²) / (2bc)].

When to use SSS versus SAS

You apply the Law of Cosines in two classic situations. In SSS (Side-Side-Side) mode, you know all three side lengths and want to find every angle. Pick the formula for the angle you want, substitute the three known sides, and take the arccos of the right-hand side. Repeat for the second angle, then subtract both from 180° to get the third. In SAS (Side-Angle-Side) mode, you know two sides and the angle wedged between them, and you want the third side. Use c² = a² + b² - 2ab cos(C), then find the remaining angles with the SSS approach. Both modes are covered here with full step-by-step working.

Derived triangle properties

Once all three sides are known, several useful properties follow. The perimeter is simply the sum a + b + c. The semi-perimeter s = (a + b + c)/2 feeds into Heron's formula for area: Area = sqrt(s(s-a)(s-b)(s-c)), which avoids needing any angle. The inradius (radius of the inscribed circle that just fits inside the triangle) is r = Area / s. The circumradius (radius of the circumscribed circle that passes through all three vertices) is R = (abc) / (4 · Area). A right triangle has a particularly clean circumradius: R = c/2 where c is the hypotenuse.

Triangle types and the cosine test

The cosine of an angle tells you immediately what type of triangle you have. If all three cosines are positive (all angles less than 90°), the triangle is acute. If one cosine equals zero, one angle is exactly 90° and the triangle is right. If one cosine is negative, one angle exceeds 90° and the triangle is obtuse. By side lengths, a triangle with all sides equal is equilateral (and also acute), two equal sides make it isosceles, and no equal sides make it scalene. The Law of Cosines distinguishes all these cases automatically from the sign and magnitude of the cosine values.

Triangle classification summary

ClassificationBy sidesBy anglesKey property
EquilateralAll sides equalAll angles 60°Highest symmetry
IsoscelesTwo sides equalTwo base angles equalLine of symmetry
ScaleneNo sides equalNo angles equalNo symmetry
Right (scalene)No sides equalOne angle = 90°a² + b² = c²
Right (isosceles)Two legs equalAngles 45-45-90°a = b, c = a sqrt(2)
Obtuse (scalene)No sides equalOne angle > 90°Longest side opposite obtuse angle
Obtuse (isosceles)Two sides equalOne angle > 90°Apex angle is obtuse
Acute (scalene)No sides equalAll angles < 90°All altitudes inside

Standard triangle classifications by side lengths and interior angles.

Frequently asked questions

What is the Law of Cosines formula?

The Law of Cosines states: c² = a² + b² - 2ab cos(C), where a, b, c are the side lengths of a triangle and C is the angle opposite side c. The formula has three symmetric versions: one for each side-angle pair. To find an angle from three sides, rearrange to get C = arccos[(a² + b² - c²) / (2ab)].

What is the difference between SSS and SAS?

SSS means you know all three side lengths (Side-Side-Side) and want to find the angles. SAS means you know two sides and the angle sandwiched between them (Side-Angle-Side) and want to find the remaining side and angles. The Law of Cosines handles both cases directly, unlike the Law of Sines, which requires at least one angle to be known first.

Can I use this calculator for a right triangle?

Yes. If one angle is exactly 90° the Law of Cosines still works perfectly and simplifies to the Pythagorean theorem: c² = a² + b². For right triangles, SOH-CAH-TOA (basic trigonometric ratios) is usually quicker, but this calculator handles both cases.

Why does the inradius formula use the semi-perimeter?

The inradius r equals the area divided by the semi-perimeter: r = Area / s. This comes from the fact that any triangle can be split into three smaller triangles by drawing lines from the incentre (centre of the inscribed circle) to each vertex. Each smaller triangle has the inradius as its height and one side of the original triangle as its base, so their combined area equals r × (a/2 + b/2 + c/2) = r × s.

How does the circumradius relate to the Law of Sines?

The circumradius R appears directly in the Law of Sines: a / sin(A) = b / sin(B) = c / sin(C) = 2R. So the common ratio in the Law of Sines is twice the circumradius. You can verify this with the formula R = (abc) / (4 · Area), which this calculator computes for you.

What happens if the triangle inequality is violated?

A valid triangle requires each side to be shorter than the sum of the other two: a < b + c, b < a + c, c < a + b. If you enter sides that break this rule (e.g. 1, 2, 10), no triangle exists and the calculator returns no result. Similarly, in SAS mode the included angle must be strictly between 0° and 180°.

Sources

Written by Grace Mbeki, MSc Data Scientist & Educator · Nairobi, Kenya

Turning everyday numbers into clear, actionable answers for the decisions that matter most.

Search 3,500+ calculators

Loading search…