Law of Sines, Law of Cosines and Law of Tangents

The law of sines, the law of cosines and the law of tangents relate the sides and angles of any triangle, not only right triangles, and let you solve a triangle from three known parts. In brief: the law of sines is a/sin A = b/sin B = c/sin C = 2R, and the law of cosines is c2 = a2 + b2 − 2ab cos C. For sides a = 7 and b = 8 with the included angle C = 60°, c2 = 49 + 64 − 56 = 57, so c ≈ 7.55.

Surveying, navigation and physics often require triangles without a right angle. The two main laws solve all four standard cases: SSS, SAS, ASA/AAS and the ambiguous SSA. This guide states the laws, shows when to use each, explains the ambiguous case with a table of outcomes and gives a short account of the law of tangents.

What is the law of sines?

In a triangle ABC with sides a, b, c opposite the angles A, B, C:

a / sin A = b / sin B = c / sin C = 2R, where R is the circumradius.

Derivation: draw the altitude h from C. In the two right triangles h = b sin A and h = a sin B. So b sin A = a sin B, i.e., a/sin A = b/sin B. The relation with the circumscribed circle follows from the inscribed angle theorem.

Example 1: ASA

A = 40°, B = 65° and c = 12. Then C = 75°. a = c sin A/sin C = 12 · 0.6428/0.9659 = 7.99. b = c sin B/sin C = 12 · 0.9063/0.9659 = 11.26.

Example 2: AAS

A = 50°, B = 60° and a = 10. Then b = a sin B/sin A = 10 · 0.8660/0.7660 = 11.31. And C = 70°, c = 10 · 0.9397/0.7660 = 12.27.

What is the law of cosines?

c2 = a2 + b2 − 2ab cos C, and similarly for the other sides. It generalises the Pythagorean theorem: for C = 90°, cos C = 0. Solving for the angle: cos C = (a2 + b2 − c2)/(2ab). If cos C > 0 the angle is acute, if cos C = 0 it is right and if cos C < 0 it is obtuse.

Derivation: place C at the origin with CB along the x-axis. Then B = (a, 0) and A = (b cos C, b sin C). The distance squared AB2 = (b cos C − a)2 + (b sin C)2 = b2 − 2ab cos C + a2.

Example 3: SAS

a = 7, b = 8, C = 60°. c2 = 49 + 64 − 2 · 7 · 8 · 0.5 = 57, so c ≈ 7.55. Then the angle A: cos A = (b2 + c2 − a2)/(2bc) = (64 + 57 − 49)/(2 · 8 · 7.55) = 72/120.8 = 0.596, so A ≈ 53.4°, and B = 180° − 60° − 53.4° = 66.6°.

Example 4: SSS

a = 5, b = 7, c = 9. cos C = (25 + 49 − 81)/(70) = −0.1, so C ≈ 95.74° (obtuse). cos A = (49 + 81 − 25)/(126) = 0.8333, so A ≈ 33.56°, and B = 180° − 95.74° − 33.56° = 50.70°. Always find the largest angle first with the law of cosines. Then the others can be found with the law of sines without ambiguity, since the other two angles are acute.

Which law should you use?

What is the ambiguous case?

When the given angle A is opposite the given side a and the other given side is b, the triangle may have two solutions, one or none. Let h = b sin A. For acute A:

For obtuse (or right) A: if a > b there is one triangle, and otherwise none.

Example 5: two triangles

A = 30°, a = 7 and b = 10. h = 10 sin 30° = 5 and 5 < 7 < 10, so there are two solutions. sin B = b sin A/a = 10 · 0.5/7 = 0.7143, so B = 45.58° or B = 134.42°. Triangle 1: C = 180° − 30° − 45.58° = 104.42°, c = 7 · sin 104.42°/sin 30° = 13.56. Triangle 2: C = 180° − 30° − 134.42° = 15.58°, c = 7 · sin 15.58°/0.5 = 3.76. Both satisfy the given data. The ambiguity relates to the failure of SSA for congruence.

Example 6: no triangle

A = 40°, a = 4, b = 10. h = 10 sin 40° = 6.43 > 4, so there is no triangle: sin B = 10 · 0.6428/4 = 1.607 > 1, impossible.

What is the law of tangents?

(a − b)/(a + b) = tan((A − B)/2)/tan((A + B)/2). It relates two sides to the difference and the sum of their opposite angles. It is equivalent to the law of sines but was convenient for hand calculations with logarithms, when two sides and the included angle are known: the sum A + B = 180° − C is known, and the formula gives A − B.

Example 7

a = 7, b = 5, C = 60°. A + B = 120°, so (A + B)/2 = 60° and tan 60° = 1.7321. (a − b)/(a + b) = 2/12 = 1/6. Then tan((A − B)/2) = 1.7321/6 = 0.2887, so (A − B)/2 = 16.10°, and A − B = 32.2°. Thus A = 76.1° and B = 43.9°. Check with the law of sines: 7/sin 76.1° = 7.21 and 5/sin 43.9° = 7.21 ✓.

Outcomes of the SSA case

Number of triangles for given angle A (acute), side a opposite A and side b
Condition Number of triangles Example (A = 30°, b = 10; h = 5)
a < b sin A0a = 4
a = b sin A1 (right triangle)a = 5
b sin A < a < b2a = 7
a ≥ b1a = 10 or a = 12

Where do the laws come from?

Greek mathematicians had geometric forms of the law of cosines in Euclid’s Elements (Book II, Propositions 12 and 13), which relate the square on a side to the squares on the other sides and a rectangle. The law of sines was developed by Islamic astronomers such as Abu al-Wafa and al-Biruni in the tenth and eleventh centuries and was used in spherical astronomy. Nasir al-Din al-Tusi gave a systematic presentation in the thirteenth century. The law of tangents was published by François Viète in the sixteenth century.

Where are they used today?

Surveyors find the distance across a river or a lake by measuring a baseline and two angles, then applying the law of sines. Navigators use the law of cosines to find the distance between two points. GPS positioning is based on triangulation, and in physics the law of cosines gives the magnitude of the resultant of two forces: R2 = F12 + F22 + 2F1F2 cos θ for the angle θ between them.

Which mistakes are common?

Pairing a side with the wrong angle

In the law of sines, each side is divided by the sine of the angle opposite to it.

Ignoring the ambiguous case

When you use the law of sines to find an angle, sin B = k has two solutions, B and 180° − B. Check whether both fit the angle sum.

Wrong sign in the law of cosines

The term is −2ab cos C. For an obtuse angle, cos C is negative, so the term adds to the sum.

Rounding too early

Keep several decimals in intermediate steps and round only the final answer.