Formula Law of Cosine for a General Triangle Third side length First side length Second side length Angle
$$c^2 ~=~ a^2 ~+~ b^2 ~-~ 2a\,b\cos(\gamma)$$ $$c ~=~ \sqrt{ a^2 ~+~ b^2 ~-~ 2a\,b\cos(\gamma) }$$
Third side length
$$ c $$ Unit $$ \mathrm{m} $$ The length of the third side of the triangle.
First side length
$$ a $$ Unit $$ \mathrm{m} $$ The length of the first side of the triangle.
Second side length
$$ b $$ Unit $$ \mathrm{m} $$ The length of the second side of the triangle.
Angle
$$ \gamma $$ Unit $$ - $$ This angle is opposite the side \( c \). So the angle between the sides \( a \) and \( b \). If \( \gamma ~=~ 90^{\circ} \), the cosine term is dropped and the Pythagorean theorem remains.