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
Keep going
- Law of cosines handles two sides and the included angle; the law of sines calculator solves the triangle instead when you know two angles and a side. Law of Sines Calculator
- Once law of cosines gives you all three sides, Heron's formula can find the triangle's area; the triangle area calculator takes it from there. Triangle Area Calculator
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