Reviewed by CalcMulti Editorial Team·Last updated: ·← Geometry Hub
The law of cosines relates the lengths of the sides of a triangle to the cosine of one of its angles: c² = a² + b² − 2ab·cos(C). It generalizes the Pythagorean theorem — when C = 90°, cos(C) = 0 and the formula reduces to c² = a² + b².
Use the law of cosines when you have: (1) all three sides (SSS) and want the angles, or (2) two sides and the included angle (SAS) and want the third side.
The law of cosines can be rearranged for any side/angle: a² = b² + c² − 2bc·cos(A), b² = a² + c² − 2ac·cos(B), c² = a² + b² − 2ab·cos(C). This calculator solves all three cases.
c² = a² + b² − 2ab·cos(C)
AAS, ASA, SSA triangle solving
Right Triangle CalculatorPythagorean theorem + angles and sides
Triangle Area CalculatorArea by base-height, Heron's, or two sides+angle
Sector Area CalculatorCircular sector area from radius and angle
Perimeter CalculatorPerimeter of triangles and common shapes
Polygon Area CalculatorRegular polygons 3–12 sides
This calculator is for educational purposes only and does not constitute professional advice. Results are based on standard mathematical formulas. Always verify critical calculations with a qualified professional before making important decisions.