Law of Cosines

One side of a triangle when the opposite angle and two sides are known. The "Law of Cosines" can be used to calculate one side of a triangle when the angle opposite and the other two sides are known.

Calculator

Inputs

Results

Side c-- m
Side a (m)Side b (m)Angle C (degrees)Side c (m)
11.360=sqrt(1^2 + 1.3^2 - 2*1*1.3*cos(60*pi/180))
22.545=sqrt(2^2 + 2.5^2 - 2*2*2.5*cos(45*pi/180))
33.590=sqrt(3^2 + 3.5^2 - 2*3*3.5*cos(90*pi/180))
1.5230=sqrt(1.5^2 + 2^2 - 2*1.5*2*cos(30*pi/180))
2.53120=sqrt(2.5^2 + 3^2 - 2*2.5*3*cos(120*pi/180))

Formula

The Law of Cosines states:

c² = a² + b² - 2ab·cos(C)

Where:

  • a, b, c = length of triangle sides (m, ft, etc.)
  • C = angle opposite side c (degrees)

Example

If side a = 1 m, side b = 1.3 m, and angle C = 60 degrees:

c = √(1² + 1.3² - 2(1)(1.3)cos(60°)) c = √(1 + 1.69 - 2.6 × 0.5) c = √(1.59) ≈ 1.26 m