The law of cosines relates the lengths of the sides of a triangle to the cosine of one of its angles. For a triangle with sides a, b and c, opposite respective angles α, β and γ, we have
c2a2b2=a2+b2−2abcosγ=b2+c2−2bccosα=a2+c2−2accosβ
For a right triangle, where γ=0, this reduces to the Pythagorean theorem: c2=a2+b2.