When you solve a triangle

Solving a triangle means recovering all six of its measurements — three sides and three angles — from three of them. Three are enough because together they fix both shape and size, with one exception: three angles fix the shape and leave the scale free, so they single out no particular triangle. You need at least one side, and from there two tools: the law of sines, a/sin α = b/sin β = c/sin γ, which ties every side to the angle facing it, and the law of cosines, c² = a² + b² − 2ab·cos γ, the general form of Pythagoras, used when the sines alone do not know enough.

Which of the two you need depends on how the data are arranged, which is why the cases have names. With three sides (SSS), or two sides and the angle between them (SAS), you start from the law of cosines, because it is the only one relating three sides to an angle. With one side and two angles (ASA or AAS) the third angle is 180° minus the other two and the law of sines sets the scale: this is the case for the reader who knows the angles and wants the sides, and it is the everyday case in surveying and triangulation, where angles measure well and distances do not.

That leaves two sides and an angle that is not between them (SSA), where there may be two triangles. The law of sines returns the sine of an angle, and two supplementary angles share a sine: if the obtuse one also closes the triangle, there are two solutions, with different third sides and different areas. This is not a flaw in the arithmetic — both figures fit the data — so this calculator shows both rather than picking one.

Common mistakes

  • Calling the longest side of a general triangle the hypotenuse and reaching for Pythagoras. Pythagoras holds only with a right angle: in the general case the −2ab·cos γ term does not vanish, and that term is exactly what the law of cosines adds.
  • Stopping at the first solution in the SSA case. Taking the arcsine of the angle always returns an acute angle, and the obtuse triangle — just as valid — disappears with nothing to flag it.
  • Pairing a side with the wrong angle. In the law of sines each side goes with the angle facing it, not with the one that happens to share a letter: side a with α, not with the angle at vertex A that it starts from.

Frequently asked questions

How do you find the sides of a triangle from its angles?

Angles alone are not enough: they give the shape but not the size, and endlessly many similar triangles share them. You need at least one side. With one side and two angles, the third angle is 180° minus the other two, and the law of sines gives the remaining sides: b = a·sin β / sin α.

How many measurements does it take to solve a triangle?

Three, at least one of which has to be a side. Three sides, two sides and an angle, or one side and two angles all work; three angles do not, because they leave the scale undetermined.

What is the ambiguous case?

It is the case of two sides and an angle that is not between them (SSA). The law of sines gives the sine of an angle, and two supplementary angles share a sine, so when the obtuse one still closes the triangle there are two solutions. This calculator reports both.

When do you use the law of cosines instead of the law of sines?

When the data are three sides, or two sides with the angle between them. In those two situations the law of sines cannot start, because no side is paired with its opposite angle yet. In every other case the law of sines is the shorter route.

How do you find the area without knowing a height?

From two sides and the angle between them: A = ½·a·b·sin γ. From three sides, use Heron's formula, A = √(s(s−a)(s−b)(s−c)) with s the semiperimeter. The calculator still shows all three heights, each recovered from the area as h = 2A/side.

How this calculation works

Law of sines: a/sin α = b/sin β = c/sin γ = 2R, where R is the circumradius. Law of cosines: a² = b² + c² − 2bc·cos α, and likewise for the other sides. Angle sum: α + β + γ = 180°. Three sides (SSS): cos α = (b² + c² − a²)/(2bc), then cos β the same way and γ by difference; the triangle exists only if each side is shorter than the sum of the other two. Two sides and the included angle (SAS): the third side from the law of cosines, then as above. One side and two angles (ASA or AAS): the third angle by difference, the remaining sides from the law of sines. Two sides and a non-included angle (SSA): sin β = b·sin α / a; if that exceeds 1 no triangle exists, otherwise both β and 180° − β are solutions, provided the sum with α stays below 180°. Area: A = ½·a·b·sin γ, equivalent to Heron's formula A = √(s(s−a)(s−b)(s−c)). Heights: h_a = 2A/a. Inradius: r = A/s.