Triangle Side Length Calculator

Find a missing side of a triangle using the Law of Cosines with step-by-step solutions.

Enter Known Values

Enter two known sides and the included angle (the angle between them) to find the third side using the Law of Cosines.

Result

Missing Side c
--
units
Side a --
Side b --
Side c (computed) --
Angle C --
Angle A (computed) --
Angle B (computed) --
Perimeter --
Area --

Step-by-Step Solution

The Law of Cosines

The Law of Cosines is a generalization of the Pythagorean theorem that works for all triangles, not just right triangles. It relates the lengths of the sides of a triangle to the cosine of one of its angles.

Law of Cosines Formulas

Find Side c

Given sides a, b and included angle C.

c = sqrt(a^2 + b^2 - 2ab*cos(C))

Find Side a

Given sides b, c and included angle A.

a = sqrt(b^2 + c^2 - 2bc*cos(A))

Find Side b

Given sides a, c and included angle B.

b = sqrt(a^2 + c^2 - 2ac*cos(B))

Special Case: Right Triangle

When C = 90 degrees, cos(C) = 0, and the formula reduces to:

c = sqrt(a^2 + b^2) (Pythagorean theorem)

When to Use the Law of Cosines

  • SAS (Side-Angle-Side): You know two sides and the angle between them, and need the third side.
  • SSS (Side-Side-Side): You know all three sides and need to find an angle (rearranged form).
  • The Law of Cosines is particularly useful in navigation, surveying, and physics for resolving vector problems.

Relationship to the Pythagorean Theorem

The Pythagorean theorem is a special case of the Law of Cosines. When the included angle C is exactly 90 degrees, cos(90) = 0, so the term -2ab*cos(C) vanishes, leaving c^2 = a^2 + b^2.