The two rules
Label the triangle so that side a is opposite angle A, side b opposite B, and side c opposite C.
Law of sines (sine rule): a / sin A = b / sin B = c / sin C
Law of cosines (cosine rule): c² = a² + b² − 2ab cos C
cos C = (a² + b² − c²) / 2ab
The sine rule links each side to its opposite angle. The cosine rule links all three sides to one angle.
How to choose in five seconds
Look for a matching pair: a side and the angle opposite it, both known.
- You have a matching pair → use the sine rule. It needs one complete pair, plus one more side or angle.
- You don't have a matching pair → use the cosine rule. That happens in exactly two situations: you know all three sides (SSS), or two sides and the angle between them (SAS).
Once you've used the cosine rule once, you'll have a matching pair, so you can switch to the sine rule if it's easier. But read the trap section below before you do.
Example 1: two sides and the angle between them (SAS)
a = 7, b = 10, C = 60°. Find c.
There's no matching pair: the angle we know (C) is opposite the side we want. So it's the cosine rule:
c² = 7² + 10² − 2 × 7 × 10 × cos 60°
= 49 + 100 − 140 × 0.5
= 79
c = √79 = 8.888
Now we have the pair (c, C), and could find the other angles with either rule. A = 43.00° and B = 77.00°.
See the working in the triangle solver.
Solve this triangleExample 2: measuring across a river (ASA)
This is the classic surveying use. You can't reach a tree on the far bank, but you can pace out a straight baseline AB = 120 m along your side and measure the angles to the tree, T, from each end: 48° at A and 71° at B.
First the third angle: T = 180° − 48° − 71° = 61°. Now there's a matching pair (AB = 120 opposite angle T = 61°), so the sine rule finds the distance from A to the tree:
AT / sin 71° = 120 / sin 61°
AT = 120 × sin 71° / sin 61° = 129.73 m
The river's width is the perpendicular distance from the tree to the baseline: 129.73 × sin 48° = 96.4 m. No-one had to get wet. Triangulation like this was used to map Great Britain in the Principal Triangulation from 1783 onwards, and the same geometry still sits inside modern surveying instruments.
Example 3: three sides (SSS), and the trap
a = 5, b = 7, c = 9. Find all the angles.
No angles known at all, so the cosine rule. Start with the largest angle, the one opposite the longest side:
cos C = (5² + 7² − 9²) / (2 × 5 × 7) = −7 / 70 = −0.1
C = cos⁻¹(−0.1) = 95.74°
Because cos C is negative, C is obtuse. The cosine rule told us that automatically; cos⁻¹ returns any angle from 0° to 180°.
The other two angles must now both be acute (a triangle can only have one obtuse angle), so the sine rule is safe for them: sin A = 5 × sin 95.74° / 9, giving A = 33.56°, and B = 180° − 95.74° − 33.56° = 50.70°.
Suppose you'd found A = 33.56° first and then used the sine rule for C:
sin C = 9 × sin 33.56° / 5 = 0.99499
C = sin⁻¹(0.99499) = 84.26°
That's wrong: the true answer is 95.74°. Both angles have the same sine (sin 84.26° = sin 95.74°), and sin⁻¹ can only ever return the one below 90°. Your calculator isn't making a mistake; the sine rule simply can't tell the difference.
The fix: use the cosine rule for the largest angle, or use the sine rule only for angles you know are acute (any angle opposite a side that isn't the longest).
Example 4: the ambiguous case (SSA)
a = 8, b = 10, A = 40°. Here we have a matching pair (a, A), so the sine rule:
sin B = 10 × sin 40° / 8 = 0.8035
B = 53.46° or B = 180° − 53.46° = 126.54°
This time the second value isn't a mistake to be discarded. Both fit:
| B | C | c | |
|---|---|---|---|
| Triangle 1 | 53.46° | 86.54° | 12.42 |
| Triangle 2 | 126.54° | 13.46° | 2.90 |
Picture it: draw angle A at the left end of a base line, with side b = 10 going up at 40°. Side a = 8 hangs from the top and has to reach the base line. Swing it like a pendulum and it touches the line in two places, giving a long triangle and a short one.
How to tell in advance how many triangles there are, when you know a, b and an acute angle A:
- a < b sin A: side a is too short to reach. No triangle. (Here b sin A = 6.43.)
- a = b sin A: it just touches. One right-angled triangle.
- b sin A < a < b: two triangles. That's our case, since 6.43 < 8 < 10.
- a ≥ b: one triangle; the second would need angles adding to more than 180°.
If A is 90° or more, there's at most one triangle, and only if a is the longest side.
The triangle solver finds both solutions and lets you switch between them.
Try the ambiguous caseSummary
| You know | First step | Watch out for |
|---|---|---|
| Three sides | Cosine rule, largest angle first | Sides that can't make a triangle (two must add to more than the third) |
| Two sides + included angle | Cosine rule for the third side | Using the sine rule afterwards for the angle opposite the longest side |
| Two angles + any side | Third angle = 180° − the others, then sine rule | Nothing; this case is always straightforward |
| Two sides + a non-included angle | Sine rule | The second solution, 180° − your answer |
And if the triangle has a right angle, you don't need either rule: SOH CAH TOA and Pythagoras are quicker. The cosine rule with C = 90° turns into Pythagoras anyway, because cos 90° = 0.