Law of Cosines

Theorem
Let $$\triangle ABC$$ be a triangle whose sides $$a, b, c$$ are such that $$a$$ is opposite $$A$$, $$b$$ is opposite $$B$$ and $$c$$ is opposite $$C$$.

Then $$c^2 = a^2 + b^2 - 2ab \cos C$$.

Proof 1
We can place this triangle onto a Cartesian coordinate system by plotting:


 * $$A = (b \cos C, b \sin C)$$;
 * $$B = (a,0)$$;
 * $$C = (0,0)$$.

By the distance formula, we have $$c = \sqrt{(b \cos C - a)^2 + (b \sin C - 0)^2}$$.

Now, we just work with this equation:

$$ $$ $$ $$

Proof 2
Let $$ABC$$ be a triangle.

Using $$AC$$ as the radius, we construct a circle.

Now we extend:
 * $$CB$$ to $$D$$;
 * $$AB$$ to $$F$$;
 * $$BA$$ to $$G$$;
 * $$CA$$ to $$E$$.

We join $$D$$ with $$E$$, and thus obtain this figure:



Using the Chord Theorem we have $$GB \cdot BF = CB \cdot BD$$.

$$AF$$ is a radius, so $$AF = AC = b = GA$$ and thus:
 * $$GB = GA + AB = b + c$$;
 * $$BF = AF - AB = b - c$$.

Thus:

$$ $$

Next:

$$ $$ $$

As $$CA$$ is a radius, $$CE$$ is a diameter.

By Angle Inscribed in Semicircle, it follows that $$\angle CDE$$ is a right angle.

Then using the definition of cosine, we have

$$ $$ $$ $$