Law Of Cosines With 3 Sides

15 min read

Law of Cosines with Three Sides: A full breakdown

When you’re given the lengths of all three sides of a triangle, the Law of Cosines is the key to unlocking the measure of any of its angles. This powerful formula generalizes the Pythagorean theorem to non‑right triangles and allows you to solve for missing side lengths or angles in any triangle, regardless of its shape. In this guide, we’ll explore the formula, walk through step‑by‑step calculations, provide real‑world applications, and answer common questions that often arise when learning this essential trigonometric tool Practical, not theoretical..


Introduction

In trigonometry, the Law of Cosines relates the three sides of a triangle to the cosine of one of its angles. For a triangle with sides of lengths a, b, and c, and with the angle opposite side c denoted as ∠C, the law states:

And yeah — that's actually more nuanced than it sounds Less friction, more output..

[ c^{2} = a^{2} + b^{2} - 2ab\cos(C) ]

This equation is symmetrical; you can similarly solve for a or b by rotating the roles of the sides and angles. The formula is indispensable for:

  • Determining unknown sides when two sides and the included angle are known (SAS case).
  • Finding an angle when all three sides are known (SSS case).
  • Checking whether a set of side lengths can form a valid triangle.

How the Law of Cosines Works

1. Visualizing the Formula

Imagine drawing a triangle with sides a, b, and c. The altitude’s length involves the cosine of ∠C, and the Pythagorean theorem applied to the two right triangles formed gives rise to the Law of Cosines. Drop an altitude from the vertex opposite side c to side c, splitting it into two segments. This geometric perspective helps you remember the minus sign in the formula: the cosine term subtracts the “overlap” created by the angle Surprisingly effective..

2. The Three Forms

Situation Formula
Side c unknown (c^{2} = a^{2} + b^{2} - 2ab\cos(C))
Side a unknown (a^{2} = b^{2} + c^{2} - 2bc\cos(A))
Side b unknown (b^{2} = a^{2} + c^{2} - 2ac\cos(B))

Some disagree here. Fair enough.

Note: ∠A is opposite side a, ∠B opposite side b, and ∠C opposite side c.

3. From Sides to Angles

When all three sides are known, you can solve for any angle by rearranging the formula:

[ \cos(C) = \frac{a^{2} + b^{2} - c^{2}}{2ab} ]

Then apply the inverse cosine function (arccos) to find ∠C. Repeat for ∠A and ∠B as needed The details matter here. That alone is useful..


Step‑by‑Step Examples

Example 1: Finding a Missing Side (SAS)

Problem: In triangle ABC, sides a = 7 m, b = 9 m, and the included angle ∠C = 45°. Find side c.

Solution:

  1. Plug values into the formula for c:

    [ c^{2} = 7^{2} + 9^{2} - 2(7)(9)\cos(45^\circ) ]

  2. Compute:

    [ 7^{2} = 49,\quad 9^{2} = 81,\quad 2(7)(9) = 126 ] [ \cos(45^\circ) = \frac{\sqrt{2}}{2} \approx 0.7071 ] [ 126 \times 0.7071 \approx 89 And that's really what it comes down to. But it adds up..

  3. Sum and subtract:

    [ c^{2} = 49 + 81 - 89.That's why 29 = 140 - 89. 29 = 50.

  4. Take the square root:

    [ c \approx \sqrt{50.71} \approx 7.12\ \text{m} ]

Answer: Side c ≈ 7.12 m Simple as that..


Example 2: Finding an Angle (SSS)

Problem: Triangle ABC has sides a = 12 cm, b = 15 cm, c = 18 cm. Determine ∠C.

Solution:

  1. Rearrange the formula to solve for cos(C):

    [ \cos(C) = \frac{a^{2} + b^{2} - c^{2}}{2ab} ]

  2. Compute the squares:

    [ a^{2} = 144,\quad b^{2} = 225,\quad c^{2} = 324 ]

  3. Plug into the expression:

    [ \cos(C) = \frac{144 + 225 - 324}{2(12)(15)} = \frac{45}{360} = 0.125 ]

  4. Find the angle:

    [ C = \arccos(0.125) \approx 82.8^\circ ]

Answer: ∠C ≈ 82.8°.


Practical Applications

Field How the Law of Cosines Helps
Surveying Determining distances between points when only partial angle measurements are available.
Navigation Calculating straight‑line distances between GPS coordinates on a curved surface (great‑circle distance).
Engineering Solving for unknown lengths in structural frameworks where angles are known.
Astronomy Computing distances between celestial bodies when angular separations are measured.
Computer Graphics Rendering realistic scenes by calculating angles between vectors in 3D space.

These examples illustrate that the Law of Cosines is not just a classroom exercise; it’s a practical tool across science and technology The details matter here..


Frequently Asked Questions

1. When is the Law of Cosines Necessary?

Use it when you have any two sides and the included angle (SAS) or all three sides (SSS). It’s also handy when you need to check if a triangle is right‑angled: if (c^{2} = a^{2} + b^{2}), then ∠C is 90° Less friction, more output..

2. How Does It Relate to the Pythagorean Theorem?

The Pythagorean theorem is a special case of the Law of Cosines where the included angle equals 90°. Setting (\cos(90^\circ) = 0) reduces the formula to (c^{2} = a^{2} + b^{2}).

3. Can the Law of Cosines Handle Negative Cosine Values?

Yes. If the angle is obtuse (>90°), (\cos) becomes negative, which increases the value of the side squared. This aligns with the geometric intuition that an obtuse angle stretches the opposite side longer Easy to understand, harder to ignore..

4. What About Floating‑Point Precision?

When computing with a calculator or software, round intermediate results carefully. Small rounding errors can propagate, especially when solving for angles using inverse cosine Most people skip this — try not to..

5. Is There a Quick Shortcut for 30°, 60°, 90° Triangles?

For right triangles with these angles, you can use the special right‑triangle ratios instead of the Law of Cosines for speed. On the flip side, the Law of Cosines still verifies the calculations.


Conclusion

The Law of Cosines is a fundamental bridge between algebra and geometry, allowing you to solve for unknown sides or angles in any triangle. By mastering its two primary forms—calculating a side from two sides and an angle, or finding an angle from three sides—you gain a versatile tool applicable to surveying, engineering, astronomy, and beyond. Practice with varied examples, and soon the formula will become an intuitive part of your mathematical toolkit Nothing fancy..

The beauty of the Law of Cosines lies in its symmetry: whether you’re chasing a missing side or a hidden angle, the same algebraic backbone supports both pursuits. In practice, most problems present themselves in one of the two canonical forms, and once you’ve internalized the derivations and the geometric intuition, the choice of form is a matter of convenience rather than necessity.

Quick Reference Cheat‑Sheet

Scenario Formula What you need Typical use
Side from two sides + included angle (SAS) (c = \sqrt{a^{2}+b^{2}-2ab\cos C}) Two sides, the angle between them Engineering frames, navigation bearings
Angle from three sides (SSS) (\cos C = \dfrac{a^{2}+b^{2}-c^{2}}{2ab}) All three sides Survey triangulation, astronomical distance
Right triangle check (c^{2}=a^{2}+b^{2}) All three sides Quick sanity check for right‑angled triangles

A handy mnemonic is “C‑A‑S‑S”: Cosine = Adjacent² + Opposite² – 2·Adjacent·Opposite·cos(Included). It reminds you that the cosine term is the only part that accounts for the angle.

Common Pitfalls to Avoid

Pitfall Why it Happens Fix
Using the wrong angle Confusing the notation (e.g., swapping (C) for (c)) Label triangles clearly and double‑check the side–angle correspondence
Neglecting the obtuse case Assuming (\cos\theta) is always positive Remember that (\cos\theta) becomes negative for (\theta>90^\circ); the formula still works
Rounding too early Small errors magnify when taking square roots or inverse cosines Keep intermediate results to at least 4–5 significant figures, round only at the end
Assuming a triangle exists Not all sets of three lengths form a triangle Verify the triangle inequality before applying the law

When to Combine with Other Laws

  • Law of Sines: Use it after the Law of Cosines to find the remaining angles, especially when you have one side and two angles (SSA).
  • Heron’s Formula: Once all sides are known, compute the area without angles.
  • Trigonometric Identities: For complex geometries, express (\cos) or (\sin) in terms of other angles to simplify calculations.

Final Words

Mastering the Law of Cosines turns an abstract algebraic identity into a practical compass for navigating the world of triangles. Think about it: whether you’re a student tackling textbook problems, a surveyor measuring distant landmarks, an engineer designing a bridge, or an astronomer charting the heavens, this law remains a cornerstone of geometric reasoning. Keep the formulas handy, practice with a variety of triangles, and soon you’ll find that the seemingly daunting task of “solving a triangle” becomes a routine, confident exercise. Happy calculating!

Extending the Law of Cosines to Vectors

When you step out of pure geometry and into the world of vectors, the Law of Cosines re‑emerges in a form that is often more intuitive for engineers and physicists. Suppose u and v are two vectors that form an angle θ between them. Their magnitudes are (|\mathbf u| = a) and (|\mathbf v| = b) It's one of those things that adds up. Simple as that..

[ |\mathbf w|^{2}=a^{2}+b^{2}-2ab\cos\theta . ]

Notice the exact correspondence with the scalar form of the law. This identity is the vector‑based proof of the law and works in any number of dimensions, provided the angle between the vectors is defined. It is especially useful when you already have coordinates for the points:

Not the most exciting part, but easily the most useful.

  1. Compute the vectors (\mathbf u = \overrightarrow{AB}) and (\mathbf v = \overrightarrow{AC}).
  2. Take the dot product (\mathbf u!\cdot!\mathbf v = ab\cos\theta).
  3. Solve for the unknown side using the rearranged formula above.

Because the dot product is a built‑in operation in most scientific computing libraries (NumPy, MATLAB, R, etc.), you can let the computer handle the heavy lifting while you focus on interpreting the result That's the part that actually makes a difference. Practical, not theoretical..

Solving Real‑World Problems: A Step‑by‑Step Blueprint

Below is a repeatable workflow that you can adapt to any situation where the Law of Cosines is the right tool.

Step Action Example
**1. Think about it: (c^{2}=144+81-216(0. Consider this: take the Square Root** (c = \sqrt{72.
**3. (AC = 8.Choose the Correct Form** Decide whether you need a side (SAS) or an angle (SSS). Document**
**5. Worth adding: This is the length of side AC. 5) ✔︎; compute ∠ACB if required. 22). Consider this:
**7. (12+9>8.50) m. Also,
6. Here's the thing — plug‑in Numbers Insert the known values into the appropriate formula. 70710678)=225-152.Sketch & Label** Draw the triangle, assign letters to sides and angles. So naturally,
**2. Here's the thing — We have two sides and the included angle → use SAS to find AC. (c^{2}=12^{2}+9^{2}-2(12)(9)\cos45^\circ). 22}\approx 8.Compute**
4. Now, verify Check triangle inequality and, if needed, recompute an angle with the Law of Sines. 78=72. Triangle ABC with known sides AB = 12 m, BC = 9 m, angle ∠ABC = 45°. 5\text{ m (3 sf)}).

Following this checklist reduces the chance of arithmetic slip‑ups and guarantees that you’re applying the law in the right context Simple as that..

Programming the Law of Cosines

For those who prefer automation, here’s a minimal Python function that works for both SAS and SSS cases:

import math
from typing import Tuple

def law_of_cosines(
    a: float = None,
    b: float = None,
    c: float = None,
    angle: float = None,
    mode: str = "SAS"
) -> Tuple[float, float]:
    """
    Returns the missing side and the missing angle.
    cos
        rad = math.- mode='SSS': a, b, c are given; returns angle C (in degrees) and verifies triangle inequality.
    On top of that, upper() == "SAS":
        if None in (a, b, angle):
            raise ValueError("SAS mode needs a, b, and included angle. - mode='SAS': a, b, angle (in degrees) are given; returns side c and angle opposite c.
    And radians(angle)
        c = math. Think about it: sqrt(a**2 + b**2 - 2 * a * b * math. ")
        # convert angle to radians for math.That said, sin(rad)) / a  # sin(C)/c = sin(A)/a, where A=angle
        C = math. Day to day, cos(rad))
        # optional: compute the opposite angle using Law of Sines
        sinC = (c * math. """
    if mode.degrees(math.

    elif mode.upper() == "SSS":
        if None in (a, b, c):
            raise ValueError("SSS mode needs a, b, and c.Because of that, ")
        # triangle inequality check
        if a + b <= c or a + c <= b or b + c <= a:
            raise ValueError("The supplied lengths do not form a triangle. So ")
        # compute angle opposite side c
        cosC = (a**2 + b**2 - c**2) / (2 * a * b)
        # guard against floating‑point rounding errors
        cosC = max(min(cosC, 1. On top of that, 0), -1. Day to day, 0)
        C = math. degrees(math.acos(cosC))
        return C, None
    else:
        raise ValueError("Mode must be either 'SAS' or 'SSS'.

*Why keep the function small?*  
- **Readability:** Each line maps directly to a step in the manual workflow.  
- **Portability:** The same logic can be copied into MATLAB, JavaScript, or even a spreadsheet macro with minimal changes.  

Feel free to extend the routine to return all three angles (use the Law of Sines after the first angle is known) or to accept vectors directly and compute the dot product internally.

### Frequently Asked Questions

| Question | Short Answer |
|----------|--------------|
| *Can I use the Law of Cosines when one side is zero?* | No. A side of length 0 collapses the triangle into a line, violating the assumptions behind the law. Here's the thing — |
| *What if the angle I have is given in grads or radians? So * | Convert to degrees (or work entirely in radians) before applying the cosine; the formula itself is unit‑agnostic. Still, |
| *Is the law valid for non‑Euclidean geometries? Because of that, * | Not directly. On the flip side, in spherical or hyperbolic geometry the relationship between sides and angles includes additional curvature terms. |
| *Why does the formula look like the dot‑product expansion?That said, * | Because the dot product \(\mathbf u\! That said, \cdot\! \mathbf v = |\mathbf u||\mathbf v|\cos\theta\) is the algebraic origin of the cosine term. The law of cosines is essentially the Pythagorean theorem with that extra term to account for the angle. 

You'll probably want to bookmark this section.

### A Quick Real‑Life Case Study

**Problem:** A civil‑engineer needs to install a support cable between two points on a bridge deck that are 30 m apart horizontally. The cable must attach to a tower that rises 12 m above the deck, but the attachment point on the tower is offset 5 m back from the line connecting the two deck points. What length of cable is required?

**Solution Sketch**

1. **Model the situation** as a triangle where  
   - side \(a = 30\) m (horizontal distance between deck points),  
   - side \(b = 5\) m (offset along the tower),  
   - included angle \(C\) is the angle between the horizontal line and the line from the offset point to the top of the tower.  
2. The vertical rise is 12 m, forming a right‑triangle with the offset side:  
   \[
   d = \sqrt{5^{2}+12^{2}} = \sqrt{25+144}= \sqrt{169}=13\text{ m}.
   \]
   So the line from the offset point to the cable attachment is 13 m long and makes an angle \(\theta = \arctan\!\left(\frac{12}{5}\right)\) with the horizontal.
3. The angle between the 30 m deck segment and this 13 m line is \(\theta\); plug into SAS:  
   \[
   c = \sqrt{30^{2}+13^{2}-2\cdot30\cdot13\cos\theta }.
   \]
   Computing \(\theta \approx 67.38^\circ\) gives  
   \[
   c \approx \sqrt{900+169-780\cos67.38^\circ}\approx \sqrt{1069-780(0.384)}\approx \sqrt{1069-299}\approx \sqrt{770}\approx 27.8\text{ m}.
   \]
4. **Result:** The required cable length is roughly **27.8 m** (rounded to three significant figures).

This example shows how the Law of Cosines can bridge the gap between a simple right‑triangle calculation (step 2) and a more general, non‑right‑angled configuration (step 3).

---

## Conclusion

The Law of Cosines is far more than a textbook theorem; it is a versatile instrument that translates geometric intuition into concrete numbers across engineering, navigation, computer graphics, and the physical sciences. By remembering its two core forms—**SAS** for unknown sides and **SSS** for unknown angles—and by pairing it with complementary tools such as the Law of Sines, Heron’s formula, and vector dot products, you acquire a complete toolkit for “solving any triangle” that you might encounter.

Keep these takeaways in mind:

1. **Label carefully** and verify the triangle inequality before you start.  
2. **Use the SAS version** when you have two sides and the angle between them; **use the SSS version** when all sides are known.  
3. **Guard against rounding errors** by retaining extra digits until the final answer.  
4. **use technology**—spreadsheets, calculators, or a few lines of code—to reduce arithmetic fatigue while still understanding each step conceptually.

With practice, the Law of Cosines will become second nature, allowing you to move from “I have these measurements, what now?That's why ” to “Here’s the exact length/angle I need, and I know why it works. So ” Whether you’re drafting a blueprint, charting a course across the sea, or simply checking that a triangle on a homework sheet is right‑angled, the cosine law is the reliable compass that points you toward the answer. Happy triangulating!
More to Read

Latest from Us

Worth the Next Click

A Few More for You

Thank you for reading about Law Of Cosines With 3 Sides. We hope the information has been useful. Feel free to contact us if you have any questions. See you next time — don't forget to bookmark!
⌂ Back to Home