Triangle Side from Two Sides & Included Angle (Law of Cosines)

Triangle Side from Two Sides & Included Angle (Law of Cosines)

Growing AI Skill PRO

Enter Calculation

Results

Third Side (c)
6.245
opposite the included angle C
Perimeter (a + b + c) 18.245
Triangle area 15.1554

Formula

c=Side a2+Side b2−2Side aSide bcos⁡(Angle C)c = \sqrt{\text{Side a}^{2} + \text{Side b}^{2} - 2\,\text{Side a}\,\text{Side b}\cos\!\left(\text{Angle C}\right)}
Usage stats

Advertisement

Report an error on this page

What this calculator does

This tool finds the length of the unknown side of a triangle when you know the lengths of two sides and the angle between them (the "included" angle). This is the classic Side-Angle-Side (SAS) situation, and it is solved with the Law of Cosines. The calculator also returns the triangle's perimeter and its area.

How to use it

Enter the two known side lengths, a and b, in any consistent unit (cm, m, inches—just be uniform). Then enter the included angle C in degrees, which is the angle formed where sides a and b meet. The result c is the side opposite that angle.

The formula explained

The Law of Cosines generalises the Pythagorean theorem: $$c^{2} = a^{2} + b^{2} - 2ab\cos C$$ When \(C = 90°\), \(\cos C = 0\) and the equation collapses to \(a^{2} + b^{2} = c^{2}\), the Pythagorean theorem. As \(C\) grows the \(-2ab\cos C\) term lengthens \(c\); for acute angles it shortens it. The area uses the related SAS formula \(A = \tfrac{1}{2}\cdot a\cdot b\sin C\).

Advertisement
Triangle with sides a and b and included angle C opposite the unknown side c
The Law of Cosines finds side c opposite the included angle C between sides a and b.

Worked example

Suppose \(a = 5\), \(b = 7\) and \(C = 60°\). Then \(\cos 60° = 0.5\), so $$c^{2} = 25 + 49 - 2(5)(7)(0.5) = 74 - 35 = 39$$ Therefore \(c = \sqrt{39} \approx 6.245\). The perimeter is \(5 + 7 + 6.245 \approx 18.245\) and the area is \(\tfrac{1}{2}\cdot 5\cdot 7\sin 60° = 17.5 \times 0.8660 \approx 15.155\).

Example triangle with sides 5 and 7 and a 60 degree included angle
Worked example: a = 5, b = 7, included angle C = 60° to find side c.

How the Third Side Changes with the Included Angle

Keep the two known sides fixed at a = 5 and b = 7 (any consistent unit) and vary only the included angle C. Here a² + b² = 74 and 2ab = 70, so \(c^2 = 74 - 70\cos C\).

C cos C c² = 74 − 70·cos C c
30° 0.8660 13.378 3.657
60° 0.5000 39.000 6.245
90° 0.0000 74.000 8.602
120° −0.5000 109.000 10.440
150° −0.8660 134.622 11.603

As C grows, c grows steadily. As C approaches 180° the triangle flattens and c approaches a + b = 12. As C approaches 0° the two sides fold onto each other and c approaches |a − b| = 2. Neither extreme is an actual triangle, so c always stays strictly between those bounds. At 90° the formula reduces to the Pythagorean theorem: \(c = \sqrt{74} \approx 8.602\).

Advertisement

Interpreting Your Result

A valid triangle's third side must satisfy the triangle inequality: \(|a - b| < c < a + b\). With a valid angle between 0° and 180°, the Law of Cosines result always falls inside this range.

  • Acute C (< 90°): \(c^2 < a^2 + b^2\).
  • Right C (= 90°): \(c^2 = a^2 + b^2\).
  • Obtuse C (> 90°): \(c^2 > a^2 + b^2\).

The largest side is always opposite the largest angle, so side c is the longest side only if C is the largest angle.

Finding the remaining angles

  1. Use the Law of Cosines again: \(\cos A = \dfrac{b^2 + c^2 - a^2}{2bc}\), then \(A = \arccos(\cdot)\). This is the safest method because arccos is unambiguous for angles from 0° to 180°.
  2. Or use the Law of Sines: \(\sin A = \dfrac{a \sin C}{c}\). Be careful: arcsin returns only angles up to 90°, so if A could be obtuse (for example, if a is the longest side), use the cosine method or check which angle is largest.
  3. Find the third angle with \(B = 180^\circ - A - C\).

Results are rounded for display, and the computed side is in the same units as the inputs (cm, m, inches, etc.). Make sure the angle is entered in degrees and is the angle between sides a and b.

FAQ

What is the "included" angle? It is the angle located between the two sides you entered—the vertex where a and b touch.

Can C be 90° or more? Yes. Any angle from just above 0° up to just below 180° forms a valid triangle. At exactly 90° you get the Pythagorean result.

Why degrees and not radians? Degrees are more intuitive for most users; the calculator converts internally to radians before applying the cosine.

Last updated:

Most popular in Math and Statistics

View all Math and Statistics calculators