Cosine Rule Calculator
Given two sides and the included angle, find the third side (Law of Cosines).
The Pythagorean Theorem's General-Purpose Cousin
The Pythagorean theorem only works when a triangle has a right angle. The cosine rule (law of cosines) removes that restriction — it finds the third side of any triangle from two sides and the angle trapped between them, and it reduces exactly to the Pythagorean theorem when that angle happens to be 90°.
The Formula
c² = a² + b² − 2ab×cos(C)
Worked Example
Given side a = 8, side b = 6, and included angle C = 60°:
| Step | Calculation | Result |
|---|---|---|
| a² + b² | 64 + 36 | 100 |
| 2ab×cos(C) | 2×8×6×cos(60°) | 48 |
| c² | 100 − 48 | 52 |
| c | √52 | 7.2111 |
At exactly C = 90°, cos(C) = 0 and the formula collapses to c² = a² + b², the ordinary Pythagorean theorem.
Where This Matters
- Navigation — computing the distance between two waypoints when the angle between the bearing lines and one leg's length are known.
- Construction layout — finding a diagonal brace length when two wall lengths and the angle at their corner are set.
- Robotics and mechanical linkages — solving the reach of a two-arm linkage from arm lengths and the joint angle.
How to Use This Calculator
- Enter Side a.
- Enter Side b.
- Enter the Included Angle C between sides a and b, in degrees.
- Select Calculate to get side c, the side opposite the given angle.
Related Calculations
Have a side and two angles instead of an included angle? Use the Sine Rule Calculator, or solve the whole triangle with the Triangle Solver.