Law of Cosines Calculator

Two Sides and Included Angle (SAS)

Enter two sides and the angle between them to calculate the remaining side and angles.

Calculation Results

Side c:
Angle A:
Angle B:
Perimeter:
Area:

Side Length Proportions

Triangle Diagram

Calculation Steps

Enter values and click Calculate to see step-by-step calculations.

Three Sides (SSS)

Enter all three sides to calculate the angles, perimeter, and area.

Calculation Results

Angle A:
Angle B:
Angle C:
Perimeter:
Area:

Two Sides and Non-Included Angle (SSA)

Enter two sides and an angle not between them. Note: This case may have 0, 1, or 2 possible solutions (ambiguous case).

Calculation Results

Enter values and click Calculate to see possible solutions.

Law of Cosines Formula

The Law of Cosines relates the lengths of the sides of a triangle to the cosine of one of its angles:

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

Where:

  • a, b, c are the sides of the triangle
  • C is the angle opposite side c

This formula is useful for:

  • Finding the third side when two sides and the included angle are known (SAS)
  • Finding the angles when all three sides are known (SSS)
  • Solving triangles in cases where the Law of Sines cannot be applied

Example Calculations

Example 1: SAS Case

Given: a = 5, b = 7, C = 60°

Find side c:

c² = 5² + 7² – 2×5×7×cos(60°)

c² = 25 + 49 – 70×0.5

c² = 74 – 35

c² = 39

c = √39 ≈ 6.245

Example 2: SSS Case

Given: a = 3, b = 4, c = 5

Find angle C:

cos(C) = (a² + b² – c²) / (2ab)

cos(C) = (9 + 16 – 25) / (2×3×4)

cos(C) = 0 / 24

cos(C) = 0

C = cos⁻¹(0) = 90°

Scroll to Top