Geometry & Trigonometry
Intermediate

Law of Cosines

Generalizes Pythagoras to any triangle.

Formula

c2=a2+b22abcosCc^2 = a^2 + b^2 - 2ab\cos C

Variables

a, b, cSides
CAngle opposite c

Example

Sides a=5, b=7, angle C=60°: c² = 25+49−2·5·7·½ = 39, c ≈ 6.24.

Did You Know?

The law of cosines is the Pythagorean theorem generalized to any triangle — the extra cosine term vanishes at 90°.