Triangle Side Calculator

Enter two known sides and the included angle between them to find the third side (Law of Cosines), plus the triangle's other two angles and perimeter.

Quick Facts

Law of Cosines
c² = a² + b² − 2ab·cos(C)
Solves for a missing side when you know two sides and the angle between them (SAS).
Valid included angle
0° < C < 180°
Outside this range the two sides can't form a closed triangle.
Right-triangle case
C = 90° → c² = a² + b²
The Law of Cosines reduces to the Pythagorean theorem.

Your Results

Calculated
Side c (opposite angle C)
-
c = √(a² + b² − 2ab·cos C)
Angle A (opposite side a)
-
From the Law of Cosines
Angle B (opposite side b)
-
180° − C − A
Perimeter
-
a + b + c

Ready

Enter two sides and the angle between them, then press Calculate.

Formula and Method for Finding a Triangle Side

When you know two sides of a triangle and the angle between them (the included angle), you can find the length of the third side with the Law of Cosines: c² = a² + b² − 2ab·cos(C), where a and b are the two known sides, C is the angle between them, and c is the unknown side opposite that angle. Unlike the Pythagorean theorem, which only works on right triangles, the Law of Cosines works on any triangle — acute, obtuse, or right.

How the calculation works

Enter the two known sides (a and b) and the angle between them (C, in degrees). The calculator squares each side, subtracts twice their product times the cosine of the included angle, and takes the square root to get side c. Once c is known, the remaining angle A (opposite side a) is recovered from the Law of Cosines rearranged as cos(A) = (b² + c² − a²) / (2bc), and angle B follows from the triangle angle sum: B = 180° − C − A. Adding all three sides gives the perimeter.

Common mistakes

  • Using the angle that isn't between the two known sides: the Law of Cosines in this form requires C to be the included angle — the one formed by sides a and b. Using a non-included angle here gives the wrong side.
  • Forgetting to convert degrees/radians: if your angle is measured in radians, convert to degrees (or adjust the formula) before entering it, since this calculator expects degrees.
  • Entering an impossible angle: the included angle must be strictly between 0° and 180°; values outside that range don't correspond to a real triangle.

Real-world applications

  • Surveying and land measurement use the Law of Cosines to find an unmeasured property boundary from two measured sides and the angle between them.
  • Navigation and aviation use it to compute distances between two points when the bearing (angle) and two known legs are available.
  • Engineering and construction use it to solve truss and framing geometry where a direct measurement of one side is impractical.
  • Physics uses the same formula (as the "law of cosines" form of vector addition) to find the resultant of two vectors given their magnitudes and the angle between them.

Frequently Asked Questions

What is the Law of Cosines and how does it find a missing triangle side?
The Law of Cosines states c² = a² + b² − 2ab·cos(C), where a and b are two known sides and C is the angle between them (the included angle). It generalizes the Pythagorean theorem to any triangle, not just right triangles, letting you solve for the third side c whenever you know two sides and the angle between them (the SAS case).
Can I find a side if I only know two angles and one side?
Yes, but that uses the Law of Sines instead: a/sin(A) = b/sin(B) = c/sin(C). This calculator solves the SAS case (two sides and the included angle) with the Law of Cosines; if you have two angles and a side (AAS or ASA), find the third angle from the 180° angle sum, then use the Law of Sines ratio to solve for the missing sides.
What angle values are valid for the included angle?
The included angle C must be strictly between 0° and 180°. At 0° or 180° the two sides lie flat on top of each other or in a straight line, so no triangle is formed and cos(C) alone cannot recover a valid shape.
Does this Law of Cosines formula work for right triangles too?
Yes. When the included angle C is exactly 90°, cos(C) = 0, so c² = a² + b² − 2ab(0) simplifies to c² = a² + b² — the Pythagorean theorem. The Law of Cosines is the general case that reduces to the Pythagorean theorem for right angles.