The Law of Cosines
The Law of Cosines (also called the Cosine Rule) is very useful for solving triangles:
It works for any triangle:
a, b and c are sides. C is the angle opposite side c |
Let's see how to use it in an example:
Example: How long is side "c" ... ?
We know angle C = 37º, a = 8 and b = 11
The Law of Cosines says: | c^{2} = a^{2} + b^{2} - 2ab cos(C) | |
Put in the values we know: | c^{2} = 8^{2} + 11^{2} - 2 × 8 × 11 × cos(37º) | |
Do some calculations: | c^{2} = 64 + 121 - 176 × 0.798… | |
Which gives us: | c^{2} = 44.44... | |
Take the square root: | c = √44.44 = 6.67 (to 2 decimal places) |
Answer: c = 6.67
How to Remember
How can you remember the formula?
Well, it helps to know it's the Pythagoras Theorem with something extra so it works for all triangles:
Pythagoras Theorem: | a^{2} + b^{2} = c^{2} | (only for Right-Angled Triangles) | ||
Law of Cosines: | a^{2} + b^{2} - 2ab cos(C) = c^{2} | (for all triangles) |
So, to remember it:
- think "abc": a^{2} + b^{2} = c^{2},
- then a 2nd "abc": 2ab cos(C),
- and put them together: a^{2} + b^{2} - 2ab cos(C) = c^{2}
When to Use
The Law of Cosines is useful for finding:
- the third side of a triangle when you know two sides and the angle between them (like the example above)
- the angles of a triangle when you know all three sides (as in the following example)
Example: What is Angle "C" ...?
The side of length "8" is opposite angle C, so it is side c. The other two sides are a and b.
Now let us put what we know into The Law of Cosines:
Start with: | c^{2} = a^{2} + b^{2} - 2ab cos(C) | |
Put in a, b and c | 8^{2} = 9^{2} + 5^{2 }- 2 × 9 × 5 × cos(C) | |
Calculate: | 64^{} = 81 + 25^{ }- 90 × cos(C) | |
Calculate some more: | 64^{} = 106 ^{ }- 90 × cos(C) | |
Now we use our algebra skills to rearrange and solve: | ||
Subtract 64 from both sides: | 0^{} = 42 ^{ }- 90 × cos(C) | |
Add "90 × cos(C)" to both sides: | 90 × cos(C) = 42^{} | |
Divide both sides by 90: | cos(C) = 42/90 | |
Inverse cosine: | C = cos^{-1}(42/90) | |
Calculator: | C = 62.2° (to 1 decimal place) |
In Other Forms
Easier Version For Angles
We just saw how to find an angle when we know three sides. It took quite a few steps, so it may help you to know the "direct" formula (which is just a rearrangement of the c^{2} = a^{2} + b^{2} - 2ab cos(C) formula):
Example: Find Angle "C" Using The Law of Cosines (angle version)
In this triangle we know the three sides:
- a = 8,
- b = 6 and
- c = 7.
Use The Law of Cosines (angle version) to find angle C :
cos C = (a² + b² - c²)/2ab
C = cos^{-1}(0.53125)
Versions for a, b and c
Also, you can rewrite the c^{2} = a^{2} + b^{2} - 2ab cos(C) formula into "a^{2}=" and "b^{2}=" form.
Here are all three:
But it is easier to remember the "c^{2}=" form and change the letters as needed !
As in this example:
Example: Find the distance "z"
The letters are different! But that doesn't matter. We can easily substitute x for a, y for b and z for c
Start with: | c^{2} = a^{2} + b^{2} - 2ab cos(C) | |
x for a, y for b and z for c | z^{2} = x^{2} + y^{2} - 2xy cos(Z) | |
Put in the values we know: | z^{2} = 9.4^{2} + 6.5^{2} - 2×9.4×6.5×cos(131º) | |
Calculate: | z^{2} = 88.36 + 42.25 - 122.2×(-0.656...) | |
z^{2} = 130.61 + 80.17... | ||
z^{2} = 210.78... | ||
z = √210.78... = 14.5 to 1 decimal place. |
Answer: z = 14.5
Did you notice that cos(131º) is negative and this changes the last sign in the calculation to + (plus)? The cosine of an obtuse angle is always negative (see Unit Circle).