Geometry Lab reference
The law of cosines
Pythagoras, extended to every triangle.
c² = a² + b² − 2ab cos C
The idea
Use the cosine rule when you know two sides and the included angle, or when you know all three sides and want to find the angles. Side c is opposite angle C. The other two versions follow by rotating the labels.
Work through an example
If a = 6, b = 8, and C = 60°, then c² = 36 + 64 − 96 × ½ = 52. Therefore c = √52 ≈ 7.211. If C were 90°, cos C would be zero and this would become the Pythagorean theorem.
What to watch for
For SAS, the given angle must sit between the two known sides. If it is opposite one of them, you have an SSA case instead.
Make the formula move.
Explore this idea with real inputs.