Law of Cosines Calculator
Enter two sides and the included angle below to instantly find the third side.
Enter two sides and the angle between them
The Law of Cosines
c² = a² + b² − 2ab·cos(C). It's the go-to formula whenever you know two sides and the angle between them (SAS) and need the third side.
Worked example
Side a = 7, side b = 10, included angle C = 45°.
c² = 7² + 10² − 2(7)(10)cos(45°) = 49 + 100 − 98.995 ≈ 50.005
c = √50.005 ≈ 7.07
Frequently Asked Questions
What is the Law of Cosines?
c² = a² + b² − 2ab·cos(C), where C is the angle between sides a and b, and c is the side opposite that angle. It generalizes the Pythagorean theorem to work on any triangle, not just right triangles.
How does the Law of Cosines relate to the Pythagorean theorem?
If angle C is exactly 90°, cos(C) = 0, and the formula reduces to c² = a² + b² — exactly the Pythagorean theorem. The Law of Cosines is a generalization that also works for triangles without a right angle.
Can the Law of Cosines find an angle instead of a side?
Yes, rearranged: cos(C) = (a² + b² − c²) / (2ab). Given all three sides, you can solve for any angle.
Related Calculators
- Sphere Calculator — Geometry & Trigonometry
- Cylinder Calculator — Geometry & Trigonometry
- Cone Calculator — Geometry & Trigonometry
- Triangle Area Calculator — Geometry & Trigonometry