Three sides and one unknown
The cosine rule, , 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 .
The sine rule cannot start here. It needs a side together with the angle facing it, and no angle is known yet.
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 . Add 2ab cos C to both sides and take from both sides: .
Then divide both sides by 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 , and the angle A comes the same way, with and added and 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 .
The cosine is exactly −½, and cos 120° = −½, so C = 120°. A calculator gives the same: .
Check by putting the angle back into the rule: , and . 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, .
If is less than , the top is positive, cos C is positive, and C is acute. If is more than , the top is negative, cos C is negative, and C is obtuse. If is exactly , 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: is more than 9 + 25 = 34, so the angle facing 7 is obtuse before any cosine is worked out.
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 on a calculator gives the right one, acute or obtuse.
The sine is different. sin 60° and sin 120° are both , 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.
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.
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 .
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 . The top is positive, so the angle is acute, just: , to 2 decimal places.
The angle facing 4 has cosine , so it is 34.77°. The angle facing 6 has cosine , 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 , 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, , before dividing by 2ab; typing divides only .
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.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.
The side opposite the angle at A is BC, so its square is the one subtracted: cos A = AB2 + AC2 − BC22 × AB × AC. 2.cos A = 25 + 64 − 492 × 5 × 8 = 4080 = 12.
cos A = 25 + 64 − 4980 = 4080 = 12. 3.(a) cos 60° = 12 exactly, so the rafter AB makes an angle of 60° with the tie beam.
(a) cos 60° = 12 exactly, so the angle is 60°. 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.
The height BN is opposite the 60° angle, so BN = 5 sin 60° = 5 × √32. 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.
(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.