The formula
c² = a² + b² − 2ab·cos C
Where it comes from
The law of cosines is the Pythagorean theorem with a correction term for triangles that are not right-angled. When C is 90° its cosine is zero, the correction vanishes and you are left with a² + b² = c² exactly.
How to work it out by hand
- To find the third side: square the two known sides, add them, then subtract 2ab·cos C
- Take the square root
- To find an angle from three sides, rearrange for cos C and take the arccosine
- Check the three angles add to 180°
What is worth knowing
The absence of ambiguity is the practical advantage. Arccosine returns a unique angle between 0° and 180°, which covers every angle a triangle can have, so there is never a second candidate to weigh up. The sign of the correction term also tells you the shape at a glance: if c² is larger than a² + b², the angle C is obtuse; if smaller, acute; if equal, exactly right. That is the converse of Pythagoras stated in a usable form, and it is how surveying software classifies triangles without computing an angle at all.