Skip to content
math

Law of Cosines Calculator

Find the third side of a triangle from two sides and the included angle (SAS).

Side c (opposite C)
5
c = √(a² + b² − 2ab·cos C)

How it works

  1. 1Enter two sides (a and b) and the angle C between them.
  2. 2The law of cosines gives c = √(a² + b² − 2ab·cos C).
  3. 3Read the length of the third side, opposite angle C.

Use cases

  • Find a missing side when you know two sides and the angle between them.
  • Solve non-right triangles (the law of cosines generalises Pythagoras).
  • Check trigonometry homework using the cosine rule.

Frequently asked questions

What is the law of cosines?

For any triangle, c² = a² + b² − 2ab·cos C, where C is the angle between sides a and b. It generalises the Pythagorean theorem.

When does it reduce to Pythagoras?

When C = 90°, cos C = 0, so c² = a² + b² — exactly the Pythagorean theorem.

What input does it need?

Two sides and the included angle (the angle between them), known as the SAS case.

See all →