mathematics-in-real-life
How to Use the Cosine Rule in Solving Non-Right Triangles
Table of Contents
Mastering the Cosine Rule for Non‑Right Triangles
While the Pythagorean theorem elegantly solves right triangles, most real‑world triangles are not right‑angled. Surveyors, engineers, navigators, and computer graphics programmers regularly face triangles with angles that are not 90°. In these situations the cosine rule (also called the Law of Cosines) becomes indispensable. This rule connects all three sides of any triangle with the cosine of a specified angle, allowing you to compute unknown lengths or angles even when no right angle exists. Mastering the cosine rule builds a foundation for more advanced geometry and trigonometry, and it frequently appears in physics, astronomy, and even robotics.
In this guide we will explore the formula in depth, walk through step‑by‑step examples for both finding a missing side and an unknown angle, discuss the ambiguous case, and highlight practical applications. By the end you will be able to apply the cosine rule confidently to any non‑right triangle.
The Law of Cosines Formula
The cosine rule is often stated in three equivalent forms, depending on which angle you know or need. For a triangle with sides a, b, and c, and the angle opposite each side denoted by the uppercase letter of the side (angle A opposite side a, angle B opposite side b, and angle C opposite side c), the rule is:
- a2 = b2 + c2 – 2bc cos A
- b2 = a2 + c2 – 2ac cos B
- c2 = a2 + b2 – 2ab cos C
Whichever version you use, the pattern is the same: the square of one side equals the sum of the squares of the other two sides minus twice the product of those sides and the cosine of the included angle (the angle between them). This relationship generalises the Pythagorean theorem. If angle C is 90°, then cos 90° = 0, and the formula reduces to c2 = a2 + b2 — the familiar Pythagorean theorem.
When to Use the Cosine Rule
The cosine rule is the go‑to method in two main scenarios:
- When you know two sides and the included angle (SAS) — you can find the third side directly.
- When you know all three sides (SSS) — you can find any angle by rearranging the formula.
There is also a third, less‑common scenario: if you know two sides and a non‑included angle (SSA), the cosine rule can help decide between the ambiguous cases that arise with the Law of Sines. But we will discuss that nuance later.
Why Not Always Use the Law of Sines?
The Law of Sines is elegant when you have an angle‑side pair, but it struggles in SAS and SSS situations. For SAS, you do not have a complete opposite angle‑side pair. For SSS, you have no angles at all. The cosine rule fills these gaps perfectly. Moreover, when using the Law of Sines in an SSA configuration, you can end up with two possible triangles (the ambiguous case). The cosine rule, being a quadratic equation, can resolve that ambiguity by yielding a unique solution because distances must be positive and angles must fit triangle geometry.
For a deeper comparison, see Math is Fun: Law of Cosines which also contrasts the two laws.
Finding a Side When You Know Two Sides and the Included Angle (SAS)
Let's walk through a detailed example from start to finish. Suppose you are tasked with finding the distance across a lake. You measure two sides along its shore as a = 120 m and b = 85 m, and the angle between them (γ) is 47°. The third side c is the distance across the water.
- Identify the known values:
- Side a = 120 m
- Side b = 85 m
- Included angle γ = 47° (between a and b)
- Choose the correct formula: We need side c opposite angle γ, so we use c2 = a2 + b2 – 2ab cos γ.
- Substitute and calculate:
a2 = 1202 = 14,400
b2 = 852 = 7,225
2ab = 2 × 120 × 85 = 20,400
cos 47° ≈ 0.681998 (using a calculator)
So c2 = 14,400 + 7,225 – 20,400 × 0.681998
= 21,625 – 13,912.76
= 7,712.24 - Take the square root: c = √7,712.24 ≈ 87.82 m.
Thus the distance across the lake is approximately 87.8 m. This type of problem is common in land surveying and often uses the cosine rule because direct measurement across water or uneven terrain is impractical.
Another SAS Example (with angles in degrees and minutes)
Sometimes angles are given in degrees and minutes. For example, in triangle ABC, side b = 10 cm, side c = 14 cm, and angle A = 35° 20' (35 degrees and 20 minutes). Find side a.
- Convert the angle to decimal degrees: 35° 20' = 35 + (20/60) = 35.3333°.
- cos 35.3333° ≈ 0.8152.
- a2 = b2 + c2 – 2bc cos A = 102 + 142 – 2(10)(14)(0.8152) = 100 + 196 – 228.256 = 67.744.
- a = √67.744 ≈ 8.23 cm.
Always double‑check that you are using the correct included angle. For side a, the included angle is angle A, which lies between sides b and c. If you mistakenly used a different angle, the result would be wrong.
Finding an Angle When You Know All Three Sides (SSS)
When all three side lengths are known, the cosine rule can be rearranged to solve for any angle. Suppose you have a triangle with sides a = 7, b = 9, and c = 10 (as in the original example). Let's find all three angles for practice.
Angle C (opposite side c = 10)
- Rearrange: cos C = (a2 + b2 – c2) / (2ab).
- Numerator: 49 + 81 – 100 = 30.
- Denominator: 2 × 7 × 9 = 126.
- cos C = 30 / 126 ≈ 0.238095.
- C = cos–1(0.238095) ≈ 76.2°.
Angle B (opposite side b = 9)
- cos B = (a2 + c2 – b2) / (2ac).
- Numerator: 49 + 100 – 81 = 68.
- Denominator: 2 × 7 × 10 = 140.
- cos B = 68 / 140 = 0.485714.
- B = cos–1(0.485714) ≈ 60.9°.
Angle A (opposite side a = 7)
- cos A = (b2 + c2 – a2) / (2bc).
- Numerator: 81 + 100 – 49 = 132.
- Denominator: 2 × 9 × 10 = 180.
- cos A = 132 / 180 = 0.733333.
- A = cos–1(0.733333) ≈ 42.9°.
Now check: 76.2° + 60.9° + 42.9° = 180.0°, confirming our calculations are consistent with the triangle angle sum.
The SSS method is a staple in navigation. For example, if you know the distances between three landmarks, you can compute the angles needed to plot a course. A resource like Khan Academy's Law of Cosines video provides visual reinforcement of these steps.
The Cosine Rule and the Ambiguous Case (SSA)
When you are given two sides and a non‑included angle (SSA), the Law of Sines can produce two possible triangles (or none). The cosine rule can help resolve this. Suppose you know side a, side b, and angle A (not between them). You can set up the cosine rule to solve for side c using the fact that side a must equal the side opposite angle A. The equation becomes a quadratic in c:
a2 = b2 + c2 – 2bc cos A
Rearrange: c2 – 2b cos A · c + (b2 – a2) = 0.
This quadratic may have zero, one, or two positive real roots for c. Each positive root corresponds to a possible triangle. Unlike the Law of Sines, which can give ambiguous angles without clarity, the cosine rule directly tells you how many triangles exist by how many positive solutions for the missing side are found.
For instance, if you have a = 10, b = 8, and A = 30°, substituting into the quadratic yields c ≈ 13.7 (one solution). If a = 6, b = 8, and A = 30°, the quadratic might give c ≈ 11.1 or c ≈ 3.6 — two possible triangles. This approach is more robust than relying solely on the sine rule. For a detailed tutorial, see BBC Bitesize: The cosine rule which includes SSA examples.
Proof and Derivation
Understanding where the cosine rule comes from can deepen your intuition. Consider triangle ABC. Drop a perpendicular from vertex B to side AC, meeting at point D. Let AD = x and DC = b – x (if we let side AC = b). In right triangle ABD, cos A = x / c, so x = c cos A. Also, the height h can be expressed using either triangle: h = c sin A (from ABD) and also from triangle BDC: h2 = a2 – (b – x)2.
Equating the two expressions for h2:
c2 sin2 A = a2 – (b – c cos A)2.
Expand the right side: a2 – (b2 – 2bc cos A + c2 cos2 A).
Recall sin2 A = 1 – cos2 A, so left side = c2 – c2 cos2 A.
Set left = right:
c2 – c2 cos2 A = a2 – b2 + 2bc cos A – c2 cos2 A.
The –c2 cos2 A terms cancel, leaving:
c2 = a2 – b2 + 2bc cos A.
Rearranging: a2 = b2 + c2 – 2bc cos A. This is the cosine rule.
This derivation shows the rule is a direct consequence of breaking the triangle into two right triangles and applying the Pythagorean theorem. It explains why the formula works for any triangle, not just acute ones; even for obtuse angles where cos A becomes negative, the geometry remains valid.
Common Mistakes and Tips
- Using the wrong angle: Make sure the angle you plug in is the one opposite the side you are solving for. In SAS, the known angle must be the included angle between the two known sides.
- Sign of cosine: Cosine can be negative for angles over 90°. This is fine — the formula handles it. For example, if you have an obtuse triangle with an angle of 120°, cos 120° = –0.5, causing the –2ab cos γ term to become positive (because –2ab(–0.5) = +ab).
- Order of operations: Compute 2ab cos γ first, then subtract it from the sum of squares. Neglecting parentheses can lead to errors.
- Calculator mode: Ensure your calculator is set to degrees (or radians, if that is your unit). Most precalculus problems use degrees.
- SSS angle size: After finding one angle, you can use the Law of Sines to find the other angles more quickly, but be aware of the ambiguous case with the sine rule. It is safer to continue with the cosine rule for all angles if you are unsure.
- Units consistency: All side measurements must be in the same units. If you mix metres and centimetres, convert first.
Real‑World Applications
The cosine rule is more than a classroom exercise. Here are fields that rely on it daily:
- Surveying and Mapping: Determining distances between points that are not directly measurable, such as across rivers, valleys, or land parcels.
- Navigation and Aviation: Calculating the ground distance between two waypoints given bearings and distances travelled, or determining the angle to correct course.
- Physics and Engineering: Resolving forces into components, analysing vector triangles that are not right‑angled, and designing truss structures.
- Astronomy: Computing distances between celestial bodies using triangulation from Earth’s surface.
- Computer Graphics: Calculating triangle properties for 3D rendering, collision detection, and ray tracing where coordinates form arbitrary triangles.
For instance, an aircraft heading 60° from Airport A flies 200 km to point B, then turns 130° (relative to its previous heading) and flies 150 km to point C. The direct distance from A to C can be found using the cosine rule, where you know two sides (200 km and 150 km) and the included angle (the angle between the two legs, which is 180° – 130° + 60°? Actually need to compute the interior angle of the triangle formed by the path — a standard navigation problem). Such applications show the rule’s practicality.
For more real‑world examples, see Open University: The Cosine Rule.
Practice Problems
To build confidence, try these on your own:
- In triangle PQR, p = 9 cm, q = 12 cm, and angle R = 45°. Find side r.
- Triangle ABC has sides AB = 8, BC = 15, CA = 17. Find the largest angle.
- A ship sails 30 km east, then 40 km northeast (45° north of east). How far is it from its starting point, and what is the bearing back?
- Two forces of 50 N and 70 N act at an angle of 60° to each other. Find the magnitude of the resultant (use the cosine rule on the force triangle).
Answers: (1) r ≈ 8.54 cm; (2) Angle B (opposite side CA=17) ≈ 90° (it's a right triangle, but verify with cosine rule); (3) distance ≈ 64.8 km, bearing ≈ 157.5° (or 22.5° west of south); (4) resultant ≈ 104.4 N.
Conclusion
The cosine rule is an essential extension of basic trigonometry that unlocks the ability to solve non‑right triangles. Its formula is straightforward, but applying it correctly requires careful identification of known sides and angles. Whether you are tackling SAS and SSS problems or dealing with the ambiguous SSA scenario, the law of cosines provides a reliable path to the answer. By practising with varied examples and understanding its derivation, you will gain the confidence to use this tool in academic, professional, and everyday contexts. The next time you face a triangle without a right angle, remember the cosine rule is your key to finding the missing piece.
For further study, visit Math is Fun Law of Cosines and Khan Academy’s Law of Cosines unit — both offer interactive tools and additional problems.