Finding Angles with the Cosine Rule

Three sides, and the angle comes out alone.

Three sides and one unknown

The cosine rule, c² = a² + b² − 2ab cos C, connects the three sides of a triangle with one of its angles. Used the usual way, it finds a side: two sides and the angle between them go in, and the third side comes out.

Now suppose all three sides are known, and an angle is wanted. Put the three sides into the same rule and the only thing left unknown is cos C. A triangle with sides 3 and 5 around the angle C and 7 facing it gives 7² = 3² + 5² − 2 × 3 × 5 × cos C.

The sine rule cannot start here. It needs a side together with the angle facing it, and no angle is known yet.

357?

All three sides are known: 3 and 5 around the angle C, and 7 facing it. The angle C is the one unknown.

Rearranging for the cosine

Start from c² = a² + b² − 2ab cos C. Add 2ab cos C to both sides and take c² from both sides: 2ab cos C = a² + b² − c².

Then divide both sides by 2ab: cos C = (a² + b² − c²) / 2ab.

Read it carefully. The two squares that are added belong to the sides that meet at the angle C. The square that is taken away belongs to the side facing C. The bottom is twice the product of the two sides that meet at C.

The rule can be written for any angle in the same pattern. For the angle B it is cos B = (a² + c² − b²) / 2ac, and the angle A comes the same way, with b² and c² added and a² taken away. In each one, the side taken away is the side facing the angle you want.

Sides 3, 5 and 7

The sides 3 and 5 meet at C, and 7 faces it, so cos C = (3² + 5² − 7²) / (2 × 3 × 5) = (9 + 25 − 49) / 30 = −15 / 30 = −½.

The cosine is exactly −½, and cos 120° = −½, so C = 120°. A calculator gives the same: cos⁻¹(−0.5) = 120°.

Check by putting the angle back into the rule: 3² + 5² − 2 × 3 × 5 × cos 120° = 34 − 30 × (−½) = 34 + 15 = 49, and 49 = 7². The angle fits the three sides.

The sign of the cosine

The bottom of the fraction, 2ab, is always positive, because a and b are lengths. So the sign of cos C is the sign of the top, a² + b² − c².

If c² is less than a² + b², the top is positive, cos C is positive, and C is acute. If c² is more than a² + b², the top is negative, cos C is negative, and C is obtuse. If c² is exactly a² + b², the top is 0, cos C = 0, and C is a right angle. That last case is the converse of Pythagoras’ theorem.

So compare the square of the side facing the angle with the sum of the other two squares. For 3, 5 and 7: 7² = 49 is more than 9 + 25 = 34, so the angle facing 7 is obtuse before any cosine is worked out.

θ = 110°hide the unit tiles

at 110° the term −2ab cos θ is 8.21, so a² + b² and c² are not equal

Find the angle where a² + b² = c²

Two sides of 3 and 4 with the angle between them as the handle. At 110° the square on the third side is 33.21, more than 9 + 16 = 25, so the angle is obtuse. Close the angle below 90° and the square drops below 25; at exactly 90° it is 25.

One cosine, one angle

Every angle of a triangle lies between 0° and 180°. On a circle of radius 1, the cosine of an angle is the distance across from the center. As the angle opens from 0° to 180°, that distance falls steadily from 1, through 0 at 90°, to −1, and it never takes the same value twice.

So each cosine between −1 and 1 belongs to exactly one angle of a triangle. A cosine of +½ can only be 60°, and a cosine of −½ can only be 120°. The cosine rule never gives two possible angles, and cos⁻¹ on a calculator gives the right one, acute or obtuse.

The sine is different. sin 60° and sin 120° are both √3/2, because the height on the circle is the same at both angles. That is why finding an angle with the sine rule can give two answers, and finding one with the cosine rule cannot.

60°½120°−½

At 60° and at 120° the height is the same, so the sines are equal. The distances across are ½ and −½, so the cosines are different.

−111−1xy120°

the point at angle θ on the unit circle has coordinates (cos θ, sin θ)

Turn until the sine is 1

The point at 120°, where the cosine is −0.5. Drag it from 0° round to 180°: the cosine falls from 1 to −1 and passes through each value only once.

An acute angle: sides 5, 7 and 8

A triangle has sides 5 and 8 around the angle C, and 7 facing it. Then cos C = (5² + 8² − 7²) / (2 × 5 × 8) = (25 + 64 − 49) / 80 = 40 / 80 = ½.

The top, 40, is positive, so C is acute, and cos 60° = ½, so C = 60°.

A whole triangle: sides 4, 6 and 7

Most triangles do not have exact angles. Take the sides 4, 6 and 7 and find all three angles.

Find the largest angle first. It faces the longest side, 7, and it is the only angle that could be obtuse. Its cosine is (4² + 6² − 7²) / (2 × 4 × 6) = (16 + 36 − 49) / 48 = 3 / 48 = 0.0625. The top is positive, so the angle is acute, just: cos⁻¹(0.0625) = 86.42°, to 2 decimal places.

The angle facing 4 has cosine (6² + 7² − 4²) / (2 × 6 × 7) = 69 / 84, so it is 34.77°. The angle facing 6 has cosine (4² + 7² − 6²) / (2 × 4 × 7) = 29 / 56, so it is 58.81°.

Check: 86.42° + 34.77° + 58.81° = 180°. Once the largest angle is known, the sine rule can also find the others, and it is safe, because the two smaller angles of a triangle are always acute, so the second answer the sine rule allows can be ignored.

When three lengths make no triangle

Try the lengths 2, 3 and 6. The angle facing 6 would have cosine (2² + 3² − 6²) / (2 × 2 × 3) = (4 + 9 − 36) / 12 = −23 / 12, which is less than −1. No angle has a cosine less than −1, and a calculator reports an error.

The rule is saying that no such triangle exists. The two shorter sides add up to 2 + 3 = 5, which is less than 6, so they cannot reach across the longest side.

The usual mistakes

Taking away the wrong square. The square taken away is the square of the side facing the angle you want. Taking away a different one gives the cosine of a different angle.

Dropping the minus sign. For 3, 5 and 7 the top is 9 + 25 − 49 = −15. Losing the sign turns −½ into ½, and 120° into 60°.

Dividing by ab instead of 2ab. For 3, 5 and 7 that gives −15 ÷ 15 = −1, which would be an angle of 180°.

Leaving out the brackets on a calculator. Work out the whole top, a² + b² − c², before dividing by 2ab; typing a² + b² − c² / 2ab divides only c².

Worked example: The Pitch of a Barn Roof from the Lengths of Its Timbers

Question The end frame of a barn roof is a triangle ABC. The horizontal tie beam AC is 8 m long, and two rafters meet at the ridge B: AB is 5 m and BC is 7 m. (a) What angle does the rafter AB make with the tie beam? (b) How high is the ridge B above the tie beam? Give the exact value and the value to 2 decimal places.

  1. 1.All three sides are known and the angle at A is wanted. The side opposite A is BC, so it is the one subtracted: cos A = AB2 + AC2 − BC22 × AB × AC.

    ACB5 m7 m8 mcos A = (AB2+ AC2− BC2)/(2 × AB × AC)
    ACB5 m7 m8 mcos A = (AB2+ AC2− BC2)/(2 × AB × AC)
    The side opposite the angle at A is BC, so its square is the one subtracted: cos A = AB2 + AC2 − BC22 × AB × AC.
  2. 2.cos A = 25 + 64 − 492 × 5 × 8 = 4080 = 12.

    ACB5 m7 m8 mcos A = (AB2+ AC2− BC2)/(2 × AB × AC)cos A = (25 + 64 − 49)/80 = 1/2
    ACB5 m7 m8 mcos A = (AB2+ AC2− BC2)/(2 × AB × AC)cos A = (25 + 64 − 49)/80 = 1/2
    cos A = 25 + 64 − 4980 = 4080 = 12.
  3. 3.(a) cos 60° = 12 exactly, so the rafter AB makes an angle of 60° with the tie beam.

    60 degACB5 m7 m8 mcos A = (AB2+ AC2− BC2)/(2 × AB × AC)cos A = (25 + 64 − 49)/80 = 1/2A = 60 deg
    60 degACB5 m7 m8 mcos A = (AB2+ AC2− BC2)/(2 × AB × AC)cos A = (25 + 64 − 49)/80 = 1/2A = 60 deg
    (a) cos 60° = 12 exactly, so the angle is 60°.
  4. 4.Drop the perpendicular BN from the ridge to the tie beam. In the right-angled triangle ABN the rafter AB is the hypotenuse and the height BN is opposite the 60° angle, so BN = 5 sin 60° = 5 × √32.

    60 degNACB5 m7 m8 mcos A = (AB2+ AC2− BC2)/(2 × AB × AC)cos A = (25 + 64 − 49)/80 = 1/2A = 60 degBN = 5 sin 60 = 5 ×√3/2
    60 degNACB5 m7 m8 mcos A = (AB2+ AC2− BC2)/(2 × AB × AC)cos A = (25 + 64 − 49)/80 = 1/2A = 60 degBN = 5 sin 60 = 5 ×√3/2
    The height BN is opposite the 60° angle, so BN = 5 sin 60° = 5 × √32.
  5. 5.(b) BN = 5√32 m, which is 4.33 m to 2 decimal places. Check: AN = 5 cos 60° = 2.5 m, so NC = 8 − 2.5 = 5.5 m, and 5.52 + 4.332 = 30.25 + 18.75 = 49 = 72, the length of the other rafter.

    60 degNACB5 m7 m8 m4.33 m2.5 m5.5 mcos A = (AB2+ AC2− BC2)/(2 × AB × AC)cos A = (25 + 64 − 49)/80 = 1/2A = 60 degBN = 5 sin 60 = 5 ×√3/2BN = 5√3/2 = 4.33 m
    60 degNACB5 m7 m8 m4.33 m2.5 m5.5 mcos A = (AB2+ AC2− BC2)/(2 × AB × AC)cos A = (25 + 64 − 49)/80 = 1/2A = 60 degBN = 5 sin 60 = 5 ×√3/2BN = 5√3/2 = 4.33 m
    (b) BN = 5√32 ≈ 4.33 m. Check: 5.52 + 4.332 = 49 = 72.

Answer: (a) 60°; (b) 5√32 m, which is 4.33 m to 2 decimal places

Common mistakes

  • Subtracting the wrong square: 52 + 72 − 822 × 5 × 7 is the cosine of the angle at the ridge B, not at A. The square subtracted is always that of the side opposite the angle wanted.
  • Taking the height as 5 cos 60° = 2.5 m. Cosine gives the side ADJACENT to the angle, which is AN along the tie beam; the height is opposite the angle, so it needs sine.

More triangle trigonometry problems, worked step by step →

Practice Finding Angles with the Cosine Rule in the app