Geometry

Law of Cosines: How to Solve SSS and SAS Triangles

Solve SSS and SAS triangles with the law of cosines. Match opposite sides and angles, check triangle inequalities, and verify worked solutions in degrees. This guide explains the reasoning, not just the keystrokes.

Published · Updated · 6 min read

Match the known measurements to SSS or SAS

The law of cosines connects three sides of a triangle with one of its angles: a² = b² + c² − 2bc cos(A). Side a is opposite angle A, and sides b and c meet at A. Use it directly to find the opposite side when two sides and their included angle are known, the SAS case. Rearrange it to find an angle when all three sides are known, the SSS case.

The positions of the measurements are essential. Two sides and an angle opposite one of them form SSA, which can have zero, one or two solutions and requires a different branch check. Do not choose SAS merely because the question provides two lengths and a degree value. Label the corners A, B and C and the opposite sides a, b and c before calculating. That sketch establishes whether the known angle truly lies between the two known sides.

See how the cosine term extends a right-triangle rule

If A = 90°, cos(A) = 0, so a² = b² + c². The familiar Pythagorean theorem is therefore a special case. For an acute included angle, the cosine is positive and the subtraction reduces a² below b² + c². For an obtuse included angle, the cosine is negative, so subtracting the cosine term increases a². This sign behavior provides a useful check on whether an entered angle is being interpreted correctly.

Keep the angle convention consistent. The Triangle Calculator expects degrees, while many programming libraries evaluate trigonometric functions in radians. A direct implementation must convert degrees by multiplying by π/180 before calling such a cosine function. A scientific calculator should be set to the intended mode. If a 60° example produces an implausible side, check angle units before changing the formula or rounding the inputs to force a preferred result.

Solve a complete SAS example

Take b = 7 cm, c = 10 cm and included angle A = 60°. Then a² = 7² + 10² − 2 × 7 × 10 × cos(60°). Since cos(60°) = 1/2, this becomes 49 + 100 − 70 = 79 cm². Therefore a = √79 cm, approximately 8.888194417 cm. The positive root supplies the missing side; a negative root does not represent another triangle with a negative side length.

Recover B using cos(B) = (a² + c² − b²) / (2ac), then find C = 180° − A − B. The approximate angles are B = 43.003911943° and C = 76.996088057°. Keep the unrounded a in that calculation. The largest side is c = 10 cm, and the largest angle is C, as expected. SAS with a valid included angle strictly between 0° and 180° determines one triangle up to reflection.

Use area as another check on the SAS geometry

The included angle also gives area K = bc sin(A) / 2. For the 7 cm, 10 cm and 60° example, K = 35 sin(60°) = 35√3/2 cm², approximately 30.310889132 cm². Perimeter is 7 + 10 + √79 cm, approximately 25.888194417 cm. These outputs describe the same solution and should remain together when copying a result into notes or a worksheet.

Use the perimeter and area to detect an obvious mismatch, not as independent new measurements. A side length copied from one problem and an angle copied from another may still generate a coherent triangle that answers neither original question. Verify the original three supplied conditions first. For this example, the height to side c is b sin(A), approximately 6.062177826 cm, and c times that height divided by two reproduces the area.

Validate three sides before solving an SSS case

For SSS, each side must be positive and the sum of any two must exceed the third. Three lengths 5, 6 and 12 cannot form a triangle because 5 + 6 < 12. Lengths 5, 6 and 11 produce a flat boundary with no positive area, not an ordinary triangle. These checks should happen before an inverse cosine is asked to turn an impossible ratio into an angle.

Consider valid sides a = 13 cm, b = 14 cm and c = 15 cm. They satisfy all strict inequalities. The angle opposite the largest side must be the largest. SSS fixes the shape and scale uniquely up to rotation or reflection; it does not produce the two alternative triangle shapes associated with some SSA cases. If the supplied side measurements are rounded and nearly flat, the numerical and measurement limitations deserve attention before interpreting many angle decimals.

Recover each SSS angle with the opposite-side formula

Rearrange the cosine rule to cos(A) = (b² + c² − a²) / (2bc). For the 13–14–15 triangle this is (196 + 225 − 169) / 420 = 0.6, giving A approximately 53.130102354°. Similarly, cos(B) = (169 + 225 − 196) / 390 = 198/390, giving B approximately 59.489762594°. The remaining angle is C approximately 67.380135052°, and the three add to 180° before display rounding.

This triangle has semiperimeter s = (13 + 14 + 15) / 2 = 21 cm. Heron's formula gives K = √(21 × 8 × 7 × 6) = 84 cm², providing an additional area check. The calculator uses numerically stable forms internally; a manual educational derivation can still show the familiar algebra. Do not replace an impossible inverse-cosine input with a rounded boundary value without first checking whether the original side data are valid.

Checked SSS and SAS examples
Case and inputsSolved anglesArea / perimeter
SAS: b = 7, c = 10, A = 60°A = 60°, B ≈ 43.003912°, C ≈ 76.996088°30.310889132 cm² / 25.888194417 cm
SSS: a = 13, b = 14, c = 15A ≈ 53.130102°, B ≈ 59.489763°, C ≈ 67.380135°84 cm² / 42 cm

All sides use centimeters. Angles are in degrees; displayed values are rounded after solving.

Enter the correct case and retain meaningful precision

In the Triangle Calculator, choose SAS and enter b, c and their included A for the first example. For the second, choose SSS and enter a, b and c. Use the same length unit for every side. A unit selection labels the inputs; it does not transform numerical centimeters into inches. Switching problem modes loads example values, so review the displayed numbers after selecting the mode and before comparing a solution with your notes.

The solver rejects insufficient, impossible or numerically unstable cases rather than presenting every positive-looking combination as a reliable triangle. Very small angles and nearly equal inequality boundaries can amplify measurement errors. Keep original side measurements, the angle convention and the final rounding rule with the answer. For practical surveying or construction, this ideal planar educational model does not establish required field accuracy, clearance or acceptance tolerances.

Distinguish a solved triangle from missing information

A full solution reports all three sides, all three angles, and any requested area or perimeter. Check the supplied measurements, the 180° angle sum and the ordering of sides against angles. For SAS, also compare the solved opposite side with |b − c| and b + c; it must lie strictly between them. These checks are quick enough to use even when a tool has already performed the calculation.

Three angles alone determine similarity, not size, and cannot establish an absolute area or perimeter. An SSA question needs the separate ambiguous-case workflow, while ASA and AAS are naturally solved using the sine rule after finding the third angle. Choosing the right input case is part of the solution. A correct cosine formula applied to mislabelled measurements remains an answer to a different triangle, so finish by connecting every result back to the original diagram.

Frequently asked questions

What does included angle mean in SAS?

It is the angle where the two known sides meet. An angle opposite one of the known sides instead gives an SSA arrangement.

Can SSS produce two different triangle shapes?

No. Valid three-side data fix one shape up to reflection or orientation.

Why must 5, 6 and 11 be rejected?

The two shorter lengths sum exactly to the longest, giving a flat configuration rather than a positive-area triangle.

Does the cosine rule require a right angle?

No. It applies to general planar triangles and reduces to the Pythagorean theorem when the included angle is 90°.

Sources

References used to support definitions and interpretation in this guide.

  1. OpenStax — Non-right Triangles: Law of Cosines
  2. OpenStax — Non-right Triangles: Law of Sines