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 = \left({b \cos C, b \sin C}\right)$
 * $B = \left({a, 0}\right)$
 * $C = \left({0, 0}\right)$

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

Now, we just work with this equation:

MIII

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:


 * CosineRule.png

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