Law of Cosines Calculator

Use c² = a² + b² − 2ab·cos C to find a missing side or angle.

Inputs

SAS for a side, SSS for an angle

Result

Enter values and click calculate.

The Law of Cosines

The Law of Cosines generalizes the Pythagorean theorem to any triangle. Given two sides and the included angle (SAS), it finds the third side. Given all three sides (SSS), it finds any angle: cos C = (a² + b² − c²) / (2ab).

Frequently Asked Questions

What is the Law of Cosines?

For any triangle: c² = a² + b² − 2ab·cos C. It generalizes the Pythagorean theorem to non-right triangles.

When should I use it?

Use SAS mode (two sides + included angle) to find the third side, and SSS mode (three sides) to find any angle.

How does it relate to the Pythagorean theorem?

When C = 90°, cos C = 0 and the formula simplifies to c² = a² + b². So Pythagoras is a special case.

Can it fail?

Yes — if your three sides do not satisfy the triangle inequality (no side is larger than the sum of the other two), there is no valid triangle.

Cookie Preferences

We use cookies to improve your experience and analyze site usage.