Law of Cosines Calculator
Law of Cosines Calculator
Enter two side lengths and the angle between them (the included angle), and this calculator solves for the third side and the other two angles.
The law of cosines generalizes the Pythagorean theorem to work for any triangle, not just right triangles — and that connection is exact, not approximate: when the included angle is exactly 90°, cos(90°) equals zero, and the formula collapses precisely into the familiar c² = a² + b². This makes it the right tool whenever a triangle problem gives you two sides and the angle between them (a scenario the more basic Pythagorean theorem can't handle on its own), which comes up constantly in surveying, navigation, and engineering problems involving non-right triangles.
- The law of cosines states that c² = a² + b² − 2ab·cos(C), generalizing the Pythagorean theorem to work for any triangle, not just right triangles.
- When the included angle is exactly 90°, cos(90°) = 0, and the formula reduces exactly to the Pythagorean theorem, c² = a² + b².
- Once the third side is known, the remaining angles are found using the law of cosines again (solved for an angle instead of a side), rather than the law of sines, to avoid ambiguity.
How does the law of cosines work?
It relates all three sides and one angle: c² = a² + b² − 2ab·cos(C), where C is the angle between sides a and b. Solving for c gives the third side directly.
If two sides are 5 and 7 with a 49° angle between them, what is the third side?
c = √(5² + 7² − 2×5×7×cos(49°)) ≈ 5.30.
Law of Cosines Calculator


Enter two side lengths and the angle between them (the included angle), and this calculator solves for the third side and the other two angles.
The law of cosines generalizes the Pythagorean theorem to work for any triangle, not just right triangles — and that connection is exact, not approximate: when the included angle is exactly 90°, cos(90°) equals zero, and the formula collapses precisely into the familiar c² = a² + b². This makes it the right tool whenever a triangle problem gives you two sides and the angle between them (a scenario the more basic Pythagorean theorem can't handle on its own), which comes up constantly in surveying, navigation, and engineering problems involving non-right triangles.

- The law of cosines states that c² = a² + b² − 2ab·cos(C), generalizing the Pythagorean theorem to work for any triangle, not just right triangles.
- When the included angle is exactly 90°, cos(90°) = 0, and the formula reduces exactly to the Pythagorean theorem, c² = a² + b².
- Once the third side is known, the remaining angles are found using the law of cosines again (solved for an angle instead of a side), rather than the law of sines, to avoid ambiguity.
How does the law of cosines work?
It relates all three sides and one angle: c² = a² + b² − 2ab·cos(C), where C is the angle between sides a and b. Solving for c gives the third side directly.
If two sides are 5 and 7 with a 49° angle between them, what is the third side?
c = √(5² + 7² − 2×5×7×cos(49°)) ≈ 5.30.
