Category: Trigonometry Level: 201
c2 = a2 + b2 - 2ab cos C
The law of cosines is the Pythagorean theorem with a correction term. The term −2ab cos C shrinks c when the angle C is acute and grows it when C is obtuse.
Sides a = 8 and b = 5 meet at the angle C = 60°. Find the third side c, across from C.
a = 8, b = 5, C = 60°, c = ?
If C were 90°, the Pythagorean theorem gives c = √89 ≈ 9.43 (dashed). The real angle is smaller, so c is shorter. A correction term accounts for the difference.
C = 90° ⇒ c2 = a2 + b2 = 89
The height h from A splits a into two pieces. The piece next to C has length b cos C, and h has length b sin C, both from SOH-CAH-TOA in the left triangle.
b cos C = 2.5, h = b sin C ≈ 4.33
The right part of the picture is a right triangle with legs h and a − b cos C and hypotenuse c. Apply the Pythagorean theorem to it.
c2 = (b sin C)2 + (a - b cos C)2
Expanding gives b² sin² C + b² cos² C, which is b² because sin² C + cos² C = 1. What remains is Pythagoras plus the correction term −2ab cos C.
c2 = a2 + b2 - 2ab cos C
Put in the numbers. The correction 2ab cos C = 40 takes c² down from 89 to 49.
c2 = 64 + 25 - 2(8)(5)(1/2) = 49, c = 7
cd svg-generator python3 -m svgmath render law-of-cosines --out /tmp/law-of-cosines
Source: svgmath/diagrams/trig_triangles.py