Cosine formula

The law of cosines (also known as the cosine formula or cosine rule) relates the lengths of the sides of a triangle to the cosine of one of its angles. Using notation as in Fig. 1, the law of cosines says
 * $$c^2 = a^2 + b^2 - 2ab\cos\gamma\,$$

where $$\gamma\,$$ denotes the angle contained between sides of lengths a and b and opposite the side of length c.