Skip to content
AllCalcHub

Law of Cosines Calculator

Use the law of cosines to find the third side from two sides and the angle between them, or any angle from three sides.

About the Law of Cosines Calculator

The law of cosines extends Pythagoras to every triangle: the extra term −2ab·cos C corrects for C not being 90°. When C = 90°, cos C = 0 and it becomes a² + b² = c².

The formula

c² = a² + b² − 2ab·cos C

Angle from sides
cos C = (a² + b² − c²) ÷ 2ab

Worked example

a = 7, b = 9, C = 50°

  1. c² = 49 + 81 − 126 × cos 50° ≈ 49.008
  2. c ≈ 7.0006

Questions people ask

Does it work for obtuse triangles?

Yes. cos C is negative when C > 90°, which makes c longer, as it should.

Why is it called the cosine rule?

Same thing; “law of cosines” is US usage.