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. Change any unit and the answer follows.
Where Law of Cosines fits
- Right-triangle trigonometry6 formulas
See also
Law of Sines: Both use triangle side length and triangle angle.Triangle Area (Two Sides and Included Angle): Both use triangle side length and triangle angle.Heron's Formula (Triangle Area from Three Sides): Both use triangle side length.Triangle Perimeter: Both use triangle side length.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.
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) (°)
Cite this page
formula.expert. (2026, November 1). Law of Cosines Formula & Calculator. https://formula.expert/solvers/law-of-cosines