Law of Cosines
Pick a mode, then enter the known parts.
Result
-
Enter numbers to see the result.
Angle A
-
Angle B
-
Formula: c^2 = a^2 + b^2 - 2ab cos C. Angle: cos C = (a^2 + b^2 - c^2) / (2ab).
Solve triangles with the law of cosines: SAS mode finds the third side, SSS mode finds an angle.
Pick a mode, then enter the known parts.
Enter numbers to see the result.
The law of cosines extends Pythagoras to any triangle: c^2 = a^2 + b^2 - 2ab cos C. When angle C is 90 degrees the cosine term vanishes and you get a^2 + b^2 = c^2 back. It is the right tool whenever you know two sides and the included angle.
Rearranged, the same formula gives any angle from the three sides: cos C = (a^2 + b^2 - c^2) / (2ab). The tool validates the triangle inequality first, so impossible side triples are rejected with an explanation.