Trigonometry⏱ 5 min read

Law of Cosines

c² = a² + b² − 2ab·cos(C)

📖 What is the Law of Cosines?

The law of cosines is a generalisation of the Pythagorean theorem that works for any triangle. When angle C = 90°, cos(90°) = 0, and the formula reduces to the familiar a² + b² = c².

c² = a² + b² − 2ab·cos(C)

🔤 What Each Variable Means

a, b
Two known sidesThe sides forming the angle C
C
Included angleThe angle between sides a and b
c
Unknown sideThe side opposite angle C

📝 Step-by-Step Example

A triangle has sides a = 5, b = 7, and included angle C = 60°. Find side c.

1
Write the formulac² = a² + b² − 2ab·cos(C)
2
Substitute valuesc² = 25 + 49 − 2(5)(7)·cos(60°)
3
cos(60°) = 0.5c² = 74 − 70(0.5) = 74 − 35 = 39
Answer: c = √39 ≈ 6.24

💡 When to Use the Law of Cosines

SAS — two sides and the included angle between them
SSS — all three sides are known (to find an angle)