🏔️ Trigonometry Peaks · Trigonometry

Law of Sines & Cosines

Solve triangles that are not right-angled using the law of sines and the law of cosines.

In short

  • In standard labelling, side a is opposite angle A — get this right before anything else.
  • The law of sines needs a side paired with its opposite angle; without such a pair, use the law of cosines.
  • The law of cosines is the Pythagorean theorem plus a correction term -2bc cos A, which vanishes at 90°.
  • Two sides and the angle between them give the area as (1/2) b c sin A.
  • Two sides and a non-included angle (SSA) may allow no triangle, one or two — compare a with b sin A, and then with b.

Beyond right triangles

SOH-CAH-TOA and the Pythagorean theorem both need a right angle. Most triangles do not have one, and two laws take over.

The standard labelling makes everything readable: the angles are A, B and C, and the side opposite each angle carries the matching lower-case letter. So side a faces angle A. Getting this labelling right is half the work.

The law of sines links each side to the angle facing it:

a / sin A = b / sin B = c / sin C

The law of cosines generalises the Pythagorean theorem:

a2 = b2 + c2 - 2bc cos A

If A = 90° then cos A = 0 and the last term vanishes, leaving a2 = b2 + c2. Pythagoras is the special case, and the -2bc cos A term is the correction for the angle not being right.

Choosing the right law

The choice comes down to one question: do you have a side together with the angle opposite it?

Use the law of sines when you have such a matched pair, which happens with

  • two angles and any side (find the third angle first with the 180° rule)
  • two sides and an angle opposite one of them

Use the law of cosines when you have no matched pair:

  • two sides and the angle between them (SAS)
  • all three sides and no angles (SSS)

A practical rule of thumb: the law of sines is easier, so reach for it first and fall back on the law of cosines only when nothing pairs up. And once the law of cosines has produced one more piece, a pair usually exists and the law of sines can finish the job.

Using the law of sines

For a side. Given A = 40°, B = 75° and a = 12, find b:

12 / sin 40° = b / sin 75° b = 12 x sin 75° / sin 40° = 18.0 (to 1 decimal place)

Set the fraction up so the unknown is on top, and it comes out with a single multiplication.

For an angle. Given A = 65°, a = 20 and b = 14, find B:

sin B = b x sin A / a = 14 x sin 65° / 20 = 0.6344 B = sin-1(0.6344) = 39.4°

Remember the inverse. The ratio 0.6344 is not the angle.

One warning: when you find an angle this way, sine is positive for both acute and obtuse angles, so there can be two possible triangles. That ambiguity is avoided whenever the known angle faces the longer side, because then the unknown angle must be the smaller one and therefore acute.

Using the law of cosines, and areas

For a side (SAS). Given b = 9, c = 14 and the angle between them A = 62°:

a2 = 81 + 196 - 2(9)(14)cos 62° a2 = 277 - 252 x 0.4695 = 158.7 a = 12.6

Note that the correction term is subtracted. If A is obtuse its cosine is negative, so subtracting it makes a larger — which is exactly what should happen as the angle opens out.

For an angle (SSS). Rearrange the same formula:

cos A = (b2 + c2 - a2) / (2bc)

Given a = 8, b = 5, c = 6: cos A = (25 + 36 - 64)/60 = -0.05, so A = 92.9°. A negative cosine simply means the angle is obtuse — no error has occurred.

Finally, two sides and the angle between them also give the area:

Area = (1/2) b c sin A

This is the familiar half-base-times-height, with the perpendicular height supplied by b sin A.

The ambiguous case, and bearings

Two sides and the wrong angle. Every arrangement above settles a triangle completely. SSA — two sides and an angle that is NOT between them — does not.

Draw angle A, mark side b along one arm, and swing side a from its far end. The perpendicular distance from that far end down to the other arm is

h = b sin A

and everything follows from comparing a with h and with b:

  • a < h: the swing never reaches the arm. No triangle.
  • a = h: it just touches. One right-angled triangle.
  • h < a < b: it cuts the arm twice. Two triangles.
  • a >= b: the second crossing falls behind A, on the wrong side. One triangle.

The algebra says the same thing. sin B = b sin A / a, and sin-1 hands back only the acute angle — but sin(180° - x) = sin x, so the supplement is an equally good solution whenever A plus that supplement is still under 180°. That is exactly the h < a < b window.

Bearings. A bearing is a direction measured clockwise from north and written with three digits: 000° is due north, 090° due east, 215° somewhere to the south-west. Two habits keep bearing problems honest.

First, a change of course of t° leaves 180° - t° inside the triangle. The angle at the turn sits between the leg coming in and the leg going out, and those two point opposite ways along the first track.

Second, a back bearing — the bearing of A from B, given the bearing of B from A — is 180° away, adding or taking off 360° to stay between 000° and 360°.

Worked examples

Example 1

In triangle ABC, A = 35°, B = 80° and a = 10 cm. Find b, to 1 decimal place.

  1. Side a and angle A form a complete pair, so the law of sines applies.
  2. 10 / sin 35° = b / sin 80°.
  3. Multiply both sides by sin 80°: b = 10 x sin 80° / sin 35°.
  4. b = 10 x 0.9848 / 0.5736 = 17.2 cm.

Example 2

A triangle has sides 7, 9 and 12. Find the largest angle, to the nearest degree.

  1. The largest angle faces the longest side, 12, so call that side a with the angle A opposite it.
  2. Three sides and no angles means the law of cosines: cos A = (b2 + c2 - a2)/(2bc).
  3. cos A = (49 + 81 - 144) / (2 x 7 x 9) = -14/126 = -0.1111.
  4. A = cos-1(-0.1111) = 96.4°, so 96° to the nearest degree — obtuse, as the negative cosine predicted.

Example 3

In triangle ABC, A = 40°, a = 9 cm and b = 12 cm. How many triangles fit, and what are the possible values of B?

  1. The known angle is not between the known sides, so this is SSA: compare a with the height h = b sin A.
  2. h = 12 x sin 40° = 7.71 cm, and 7.71 < 9 < 12, so a lands inside the two-triangle window.
  3. sin B = b sin A / a = 12 x sin 40° / 9 = 0.8571, and sin-1(0.8571) = 59.0°.
  4. The supplement has the same sine, so B = 180° - 59.0° = 121.0° as well. Both close, because 40° + 121° is still under 180°.

Example 4

A ship sails 18 km on a bearing of 050°, then 25 km on a bearing of 110°. How far is it from its starting point, to 1 decimal place?

  1. The course changes by 110° - 50° = 60°, so the angle inside the triangle at the turn is 180° - 60° = 120°.
  2. Two sides with that angle between them means the law of cosines: d2 = 182 + 252 - 2(18)(25)cos 120°.
  3. cos 120° = -0.5, so the correction term is added: d2 = 324 + 625 + 450 = 1399.
  4. d = sqrt(1399) = 37.4 km — longer than either leg, which is what an obtuse angle at the turn should do.

Practice problems, with solutions

Three problems of increasing difficulty, each with the full working. In the game these are generated fresh every time; these three are fixed so this page always shows the same ones.

Problem 1

Difficulty 1 of 5

In triangle ABC, angle A = 80°, angle B = 40° and side a = 15 cm (a is opposite A). How long is side b? Round to 1 decimal place.

Answer: 9.8 cm

  1. a / sin A = b / sin B
  2. 15 / sin(80°) = b / sin(40°)
  3. b = 15 x sin(40°) / sin(80°)
  4. b = 15 x 0.6428 / 0.9848 = 9.8 cm

Problem 2

Difficulty 3 of 5

In triangle ABC, angle A = 94°, side a = 16 cm and side b = 15 cm (each side is opposite the angle with the same letter). Find angle B, to the nearest degree.

Answer: 69 degrees

  1. a / sin A = b / sin B
  2. sin B = b x sin A / a = 15 x sin(94°) / 16
  3. sin B = 0.9352
  4. B = sin-1(0.9352) = 69.26° = 69° to the nearest degree

Problem 3

Difficulty 4 of 5

In triangle ABC, side b = 38 cm, side c = 23 cm and the angle between them, angle A, is 112°. How long is side a? Round to 1 decimal place.

Answer: 51.3 cm

  1. a2 = b2 + c2 - 2bc cos(A)
  2. a2 = 1444 + 529 - 2(38)(23)cos(112°)
  3. a2 = 1973 - -654.812 = 2627.812
  4. a = sqrt(2627.812) = 51.3 cm

Common mistakes

  • Pairing a side with an angle that is not opposite it.
  • Reporting the ratio instead of applying sin-1 or cos-1 to get the angle.
  • Adding the 2bc cos A term instead of subtracting it, or forgetting the final square root.
  • Treating a negative cosine as an error rather than as an obtuse angle.
  • Stopping at the acute angle sin-1 returns when the SSA information allows an obtuse second triangle too.
  • Using the change of course as the angle inside a bearings triangle, instead of its supplement 180° minus it.

What you should be able to do

  • Choose between the law of sines and the law of cosines.
  • Find a missing side or angle in an oblique triangle.
  • Find the area of a triangle from two sides and the included angle.
  • Apply the laws to navigation and surveying problems.

Where this fits in the curriculum

Common Core

  • HSG-SRT.D.10

    High school — Prove the Laws of Sines and Cosines. (+)

  • HSG-SRT.D.11

    High school — Understand and apply the Laws of Sines and Cosines to find unknown measurements in right and non-right triangles. (+)

  • HSG-SRT.D.9

    High school — Derive the formula A = ½ab·sin(C) for the area of a triangle. (+)

Learn these first

This leads on to