Law of Cosines Calculator

Solve triangles using Law of Cosines. Free online law of cosines calculator.

The Law of Cosines Calculator solves triangles using c² = a² + b² - 2ab·cos(C) and its variations. This generalization of the Pythagorean theorem works for any triangle, not just right triangles. Enter known sides and angles to find missing measurements in SAS and SSS triangle problems.

Law of Cosines Calculator

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

Worked example

Known values
Two sides and the included angle (SAS) → find side c
Side a
5
Side b
7
Angle C in degrees (SAS) or side c (SSS)
60
Side c
6.244998
Sides a, b, c5, 7, 6.245
Angles A, B, C43.8979°, 76.1021°, 60°
Area15.1554
Perimeter18.245
Step by step
  1. c² = 5² + 7² − 2 × 5 × 7 × cos(60°) = 39
  2. c = √39 = 6.244998

Replace these values in the calculator above to compute your own numbers.

Common use cases

  • Navigation distance calculations
  • Surveying and mapping
  • Physics force problems
  • Architecture and construction
  • Astronomy orbital calculations

How to use

  1. For SAS: enter two sides and included angle
  2. For SSS: enter all three sides
  3. Click calculate for missing values
  4. View all sides and angles
  5. See the calculation steps

FAQ

What is the Law of Cosines?

c² = a² + b² - 2ab·cos(C). It relates the three sides and one angle of any triangle.

How is it related to Pythagorean theorem?

When C = 90°, cos(C) = 0, and it becomes c² = a² + b²—the Pythagorean theorem!

When do I use Law of Cosines?

Use for SAS (two sides and included angle) or SSS (all three sides known).

How do I find an angle from three sides?

Rearrange: cos(C) = (a² + b² - c²)/(2ab), then take arccos.