Law of Cosines
Generalises Pythagoras to any triangle.
Formula
Variables
Example
a=3,b=4,C=90° ⇒ c=5
How it works
The Law of Cosines lets you find an unknown side or angle in any triangle, not just right triangles. It works because if you drop an altitude and split the triangle into two right triangles, the horizontal parts involve cosines; combining those pieces produces the extra "-2ab\cos C" term. When C is 90°, cos C = 0, so the formula becomes the Pythagorean theorem.
When to use it
Use this when you know two sides and the included angle and want the third side, or when you know all three sides and need an angle. It is especially useful in surveying, navigation, physics, and any triangle that is not a right triangle.
Worked example, step by step
Suppose a = 7, b = 10, and C = 60°. Use c^2 = a^2 + b^2 - 2ab\cos C c^2 = 7^2 + 10^2 - 2(7)(10)\cos 60° c^2 = 49 + 100 - 140(0.5) c^2 = 149 - 70 c^2 = 79 c = \sqrt{79} c \approx 8.89 So the third side is about 8.9 units.
Common mistakes to avoid
- Using the angle opposite the wrong side in the cosine term
- Forgetting that the formula uses the included angle between sides a and b
- Calculating cos in degrees/radians incorrectly for the given angle
Did You Know?
The law of cosines is the Pythagorean theorem generalized to any triangle — the extra cosine term vanishes at 90°.
Share this formula
More in Trigonometry
View allSine Ratio (SOH)
BasicRatio of the side opposite an angle to the hypotenuse.
Cosine Ratio (CAH)
BasicRatio of the side adjacent to an angle to the hypotenuse.
Tangent Ratio (TOA)
BasicRatio of the opposite side to the adjacent side.
Cosecant
IntermediateReciprocal of sine.
Secant
IntermediateReciprocal of cosine.
Cotangent
IntermediateReciprocal of tangent.