The Law of Cosines
📐 What is the Law of Cosines?
The Law of Cosines is a powerful generalization of the Pythagorean Theorem that works for any triangle — not just right triangles. It relates the lengths of the sides of a triangle to the cosine of one of its angles.
The Law of Cosines Formula
$$c^2 = a^2 + b^2 - 2ab\cos(C)$$
Where $a$, $b$, and $c$ are the sides of a triangle, and $C$ is the angle opposite to side $c$.
🔗 Connection to the Pythagorean Theorem
Notice what happens when angle $C = 90°$:
Since $\cos(90°) = 0$, the formula becomes:
$c^2 = a^2 + b^2 - 2ab \cdot 0 = a^2 + b^2$
That's exactly the Pythagorean Theorem! So the Law of Cosines is a more general version that handles all triangles.