FINAL TOOLBOX
04 // Interactive Formula Compendium // GEOMETRY-TRIGc² = a² + b² − 2ab · cos(C)

Law of Cosines Formula — Oblique Triangle SAS & SSS Solver Sheet

The Law of Cosines relates the lengths of the three sides a, b, c of any plane triangle to the cosine of an interior angle C via c² = a² + b² − 2ab cos(C), reducing to a² + b² = c² when C = 90°.

Formula Reference
Main Formula
c² = a² + b² − 2ab · cos(C)
Rearranged Forms
cos(C) = (a² + b² − c²) / (2ab) (Angle Form for SSS)
a² = b² + c² − 2bc · cos(A)
b² = a² + c² − 2ac · cos(B)
Variables & Units
Variables & Units — Law of Cosines Formula — Oblique Triangle SAS & SSS Solver Sheet
SymbolNameUnit
cOpposite Side Length (c)m
aSide Length am
bSide Length bm
C_degIncluded Angle C (degrees)deg
Inputs & Parameters
[m]
[m]
[deg]
Calculated Result (Opposite Side Length (c))
c =6.666345m

Formula Notes & Background

  • Drop an altitude h from vertex B onto side a (or its extension), dividing side a into segments b cos(C) and a − b cos(C) with height h = b sin(C).
  • Apply the Pythagorean theorem to the right triangle containing hypotenuse c: c² = (b sin C)² + (a − b cos C)².
  • Expand and apply sin²C + cos²C = 1 to obtain c² = a² + b² − 2ab cos(C).

Step-by-Step Examples

#1: Find side c of a triangle with sides a = 8 m, b = 11 m, and included angle C = 37°.
a = 8 mb = 11 mC = 37° (cos 37° ≈ 0.79864)
c = √(8² + 11² − 2(8)(11)cos(37°)) = √(64 + 121 − 140.56)
→ c = √44.44 ≈ 6.666 m
#2: Find the largest angle C in a triangle with sides a = 5, b = 6, c = 9.
a = 5b = 6c = 9
cos(C) = (5² + 6² − 9²) / (2 × 5 × 6) = (25 + 36 − 81) / 60 = −20 / 60
→ C = arccos(−1/3) ≈ 109.47° (obtuse triangle)
Was this tool helpful?

Frequently Asked Questions

When should you use the Law of Cosines instead of the Law of Sines?+

Use the Law of Cosines when you know two sides and the included angle (SAS) or all three sides (SSS), where no angle-side opposite pair is initially known.

Why does the Law of Cosines avoid the obtuse-angle ambiguity of the Law of Sines?+

Because cos(θ) is strictly decreasing and one-to-one on (0°, 180°), arccos((a²+b²−c²)/2ab) uniquely distinguishes acute (cos > 0) from obtuse (cos < 0) angles.

What happens when C = 90°?+

Since cos(90°) = 0, the cross term −2ab cos(90°) vanishes and the formula becomes the Pythagorean theorem c² = a² + b².