The law of cosines is another method to solve a triangle. In this method, the cosines of the interior angles are included in the formulas. The law of cosines uses three different formulas depending upon the different situations.
Consider the following triangle:
Then these identities hold true among the sides and interior angles:
a2 = b2 + c2 – 2b c (cos A)
b2 = a2 + c2 – 2 ac (cos B)
c2 = a2 + b2 – 2 a b(cos C)