Law of Cosines Calculator
Enter two sides and the angle between them, and find the third side and the remaining angles using the law of cosines.
How to use the law of cosines calculator
- Enter side a and side b.
- Enter the angle C between these two sides, in degrees.
- Side c and the two remaining angles update automatically.
What is the law of cosines?
The law of cosines generalizes the Pythagorean theorem to all triangles, not just right triangles: c² = a² + b² − 2ab·cos(C). It's used to find the third side of a triangle when you know the other two sides and the angle between them (SAS), or to find all the angles when you know all three sides (SSS).
Frequently asked questions
How does the law of cosines relate to the Pythagorean theorem?
The Pythagorean theorem is a special case of the law of cosines where the angle between the two known sides is exactly 90° — the term −2ab·cos(C) disappears, since cos(90°) = 0.
When do I use the law of cosines instead of the law of sines?
Use the law of cosines when you know two sides and the angle between them, or all three sides. Use our law of sines calculator when you instead know two angles and one side.
What is the law of cosines used for in practice?
Among other things, in surveying, navigation and physics — for example, to calculate the distance between two points when you know the distances from a third point and the angle between them (triangulation).