Finds the three angles (in degrees) from the three sides with the law of cosines cos A = (b² + c² − a²) ÷ 2bc.
Explanation
When all three sides are known, the law of cosines rearranged for the cosine hands you every angle of the triangle. An inverse cosine turns each value back into an angle.
cosA=2bcb2+c2−a2 - a, b, c — the three side lengths
- A — the angle opposite side a; in the same way cosB=2cac2+a2−b2
- the last angle follows from C=180∘−A−B, since the interior angles add to 180∘
In the numerator you always subtract the square of the side opposite the angle you want. Subtract the wrong one and you get a different angle.
Example
With a=5, b=6 and c=7:
cosA=2×6×762+72−52=8460=75 which gives A≈44.4153∘. Likewise cosB=7038=3519, so B≈57.1217∘, leaving C≈78.4630∘. The three add to exactly 180∘.
Notes
- The sides must be positive and must satisfy the triangle inequality: any two of them have to add up to more than the third. Check all three cases (5+6>7, and so on). Lengths that fail it form no triangle, and the calculator reports the error.
- A negative cosine means the angle is obtuse. A triangle can hold at most one obtuse angle.
- The largest angle always faces the longest side. Above, the longest side is c=7, and C is indeed the largest angle.
- Three sides determine a triangle completely, so the three angles are uniquely determined too.