Law of Cosines Calculator
Law of cosines calculator: third side of a triangle from two sides and the included angle, or an angle from three sides.
c² = a² + b² − 2ab · cos γ
How to use this calculator
- Choose the quantity you want under “Solve for”.
- Type the known values and pick their units: any combination works.
- The result updates as you type. Open “Show the steps” to see the substitution.
c² = a² + b² − 2ab cos γ generalises Pythagoras to any triangle; with γ = 90° it becomes c² = a² + b².
Formula
c² = a² + b² − 2ab · cos γ
| Symbol | Quantity | Units |
|---|---|---|
| a | Side a | m, km, cm, mm, µm, nm, pm, Å, in, ft, yd, mi, nmi, au, ly |
| b | Side b | m, km, cm, mm, µm, nm, pm, Å, in, ft, yd, mi, nmi, au, ly |
| γ | Angle γ (between a and b) | °, rad, gon, turn, ′, ″, mrad |
| c | Side c (opposite γ) | m, km, cm, mm, µm, nm, pm, Å, in, ft, yd, mi, nmi, au, ly |
Worked example
Given: a = 8 cm · b = 5 cm · γ = 60 °
c = √(a² + b² − 2ab cos γ)
Result: c = 7 cm
Frequently asked questions
Third side with a = 8, b = 5 and γ = 60°?
c = √(64 + 25 − 40) = 7.