Law of Cosines
Also known as cosine rule
Worked example: Sides 5 m and 8 m at 60° → third side 7 m — press Try an example to run it live, then adjust anything.
Enter your known values, leave one input blank, and solves for the missing one. Tap a variable’s symbol to see what it means, with a typical value. Try different units for next level excitement!
The cosine law →
Grade 11Grade 11 Math — Functions & Applications
Two forces, one resultant →
Grade 12Grade 12 Math
Test your skills in the Exam Room: new numbers every attempt — free lessons for students, no sign-up, just pure learning. Find 1 more lesson on this formula.
share your results
Law of Cosines explained
The law of cosines is the Pythagorean theorem with a correction term: when angle C is exactly 90°, cos C vanishes and c² = a² + b² reappears. Open the angle wider and the correction adds length; squeeze it and the correction subtracts. Euclid proved both cases geometrically around 300 BCE, and the Persian astronomer al-Kashi gave the modern trigonometric form in the 1400s — in France the result still carries his name. A surveyor's example: from one station, two landmarks lie 8 km and 5 km away with 60° between the sightlines, so their separation is km.
Solved for the angle, C = arccos((a² + b² − c²)/(2ab)) uses the principal branch of arccos, spanning 0° to 180° — precisely the range of a triangle's interior angle, so the answer is unique with no ambiguous case. The three sides must obey the triangle inequality, or the arccos argument escapes [−1, 1] and no triangle exists.
Law of Cosines formula
- = Side a (m)
- = Side b (m)
- = Side c (opposite angle C) (m)
- = Angle C (between a and b) (°)
Missing one of these? Work it out first, then come back
- Side a — Triangle Perimeter, Parallelogram Perimeter
- Side b — Triangle Perimeter, Parallelogram Perimeter
- Side c (opposite angle C) — Right-Triangle Sine Ratio (SOH), Right-Triangle Tangent Ratio (TOA)
- Angle C (between a and b) — Dot Product from Magnitudes and Included Angle, Angle Between Two 2D Vectors (Components)