Trigonometry

Law of Cosines Calculator

The calculator uses the law of cosines when you know two sides and the included angle, or when you know all three sides. The result is the missing side or the angle opposite side c, with the substitutions written in order.

Known parts

Needed only when you find angle C.
Needed only when you find side c.

Try a worked example

Lesson: SAS and SSS

The law of cosines is the cosine version of the Pythagorean theorem. When angle C is 90°, cos(C) is 0 and the formula reduces to c² = a² + b². For an acute or obtuse included angle the extra term −2ab cos(C) shortens or lengthens the opposite side.

SAS uses two sides and the angle between them to find the third side. SSS uses three sides to find an angle. The calculator rejects a side of 0, a negative length, and side lengths that fail the triangle inequality.

Practice problems

1. Missing side

Sides a = 7 and b = 10 meet at angle C = 60°. Find side c.

2. Missing angle

Sides a = 8, b = 6, and c = 7. Find angle C.

Show answers

Problem 1. c² = 49 + 100 − 140 · 0.5 = 79, so c is about 8.888.

Problem 2. cos(C) = (64 + 36 − 49) / 96 = 51/96 = 0.53125, so C is about 57.91°.