Does Law Of Cosines Work For All Triangles
Does the Law of Cosines Work for All Triangles?
You’ve probably seen a triangle on a math test and wondered why you can’t just plug in two sides and an angle and call it a day. Think about it: the law of cosines is often presented as the go‑to formula for “when you have two sides and the included angle,” but does it really cover every possible triangle out there? Let’s break it down, from the basics to the edge cases, so you can stop guessing and start solving with confidence.
What Is the Law of Cosines?
The law of cosines (sometimes called the cosine rule) is a relationship between the lengths of the three sides of a triangle and the cosine of one of its angles. In plain terms, it lets you find a missing side when you know two sides and the angle between them, or it can help you find an unknown angle when you know all three sides. The classic formula looks like this:
c² = a² + b² – 2ab·cos(C)
Here, c is the side opposite the angle C, while a and b are the other two sides. If you rearrange the equation, you can also solve for an angle:
cos(C) = (a² + b² – c²) / (2ab)
That’s the core idea: the cosine of an angle “balances” the squares of the sides around it. It works for any triangle you can draw on a flat surface, but the practicality of using it varies depending on what you already know.
How It Differs From the Law of Sines
Before we dive deeper, it’s worth noting the sibling formula that often gets mentioned alongside it. The law of sines relates the ratios of side lengths to the sines of their opposite angles:
a / sin(A) = b / sin(B) = c / sin(C)
Each has its sweet spot. The law of sines shines when you have two angles and any side (the AAS or ASA cases). Practically speaking, the law of cosines, on the other hand, is the hero for SAS (two sides and the included angle) or SSS (all three sides). Knowing when each applies is the first step to mastering triangle solving.
Why It Matters / Why People Care
If you’re a student, a DIY builder, or anyone who’s ever tried to figure out the distance across a sloped roof, the law of cosines is more than a classroom abstraction. It’s the bridge between abstract geometry and real‑world measurements. Imagine you’re designing a truss for a bridge. You know the lengths of two beams and the angle at their junction. Plugging those numbers into the cosine formula tells you exactly how long the third beam needs to be—no trial and error, no guesswork.
In engineering, architecture, and even computer graphics, the ability to calculate unknown sides or angles quickly can save time and material. That’s why the law of cosines is a staple in textbooks and a tool in many professional toolkits. It’s not just a formula; it’s a problem‑solving shortcut that works whenever you have the right inputs.
How It Works for All Triangles
At first glance, the law of cosines seems universal: it contains every side and every angle, so it should apply to any triangle—acute, right, or obtuse. In theory, yes. In practice, there are nuances that affect how useful it is.
When It Shines
- SAS situations – Two sides and the angle between them are known. This is the classic use case. Because the included angle is known, you can directly compute the third side without ambiguity.
- SSS situations – All three sides are known, and you need an angle. Rearranging the formula gives you the cosine of the angle you want, and you can find the angle with an inverse cosine.
- Right triangles – If the angle you’re solving for is 90°, the cosine term drops out (cos 90° = 0), and the formula reduces to the familiar Pythagorean theorem. So the law of cosines actually includes the Pythagorean theorem as a special case.
When It Runs Into Trouble
- SSA (Side‑Side‑Angle) ambiguity – You know two sides and an angle that is not between them. In this case, the law of cosines can be applied, but you’ll end up with a quadratic that may have two possible solutions. The ambiguity isn’t a flaw of the law itself; it’s a limitation of the information you have. Many textbooks steer you toward the law of sines for SSA because it’s clearer about the two possible configurations.
- Very small or very large angles – When the angle is close to 0° or 180°, the cosine value approaches 1 or –1, and the formula can become numerically unstable. In computer calculations, rounding errors may creep in, but for hand calculations it’s usually fine.
- Degenerate triangles – If the three points are collinear (the “triangle” has zero area), the law of cosines still holds mathematically, but the result is a side length that equals the sum of the other two. That’s a degenerate case that rarely matters in practice.
Common Mistakes / What Most People Get Wrong
-
Using the law of cosines for SSA without checking for ambiguity
Many students plug two sides and a non‑included angle into the cosine formula and assume they have a single answer. They forget that the cosine of an angle doesn’t distinguish between an acute and an obtuse angle with the same cosine value. The result can be a “ghost” triangle that doesn’t exist. -
Confusing the included angle
The law of cosines only works when the angle you know sits between* the two sides you have. If you accidentally use the wrong angle, you’ll end up with the wrong side length. A quick sketch and labeling of sides (a, b, c) can prevent this slip. -
Assuming it’s always more accurate than the law of sines
In some cases, especially with very small angles, the law of sines can be more numerically stable. The law of cosines is powerful, but it’s not a universal silver bullet.Want to learn more? We recommend what is the greatest common factor of 3 and 6 and is internal energy intensive or extensive for further reading.
-
Neglecting to check units
If you mix degrees and radians, the cosine value will be wildly off. Always verify that your calculator (or software) is set to the correct mode before you compute. -
Overlooking the Pythagorean shortcut
When you have a right triangle, the law of cosines collapses to the Pythagorean theorem. Many students go through the extra steps of plugging
Many students go through the extra steps of plugging in $\cos(90^\circ) = 0$ when a simple $a^2 + b^2 = c^2$ would have been faster and less prone to keystroke errors. Recognizing the right triangle hidden inside a problem is often the most efficient path to the answer.
A Quick Derivation (So You Never Have to Memorize It)
If you understand why the formula works, you can reconstruct it in seconds. Drop an altitude from vertex $C$ onto side $c$, splitting the triangle into two right triangles. Let the foot of the altitude divide side $c$ into segments $x$ and $c-x$.
- In the left right triangle: $h^2 = a^2 - x^2$.
- In the right right triangle: $h^2 = b^2 - (c-x)^2 = b^2 - c^2 + 2cx - x^2$.
- Set the two expressions for $h^2$ equal: $a^2 - x^2 = b^2 - c^2 + 2cx - x^2$.
- Cancel $-x^2$ and solve for $x$: $x = \frac{a^2 + c^2 - b^2}{2c}$.
- Substitute $x$ back into the cosine definition for angle $B$ (or $A$): $\cos B = \frac{x}{a}$.
- Rearrange to get the standard form: $b^2 = a^2 + c^2 - 2ac\cos B$.
The symmetry of the derivation shows immediately why the formula cycles cleanly through $a, b, c$ and $A, B, C$.
Practical Workflow: A Decision Tree
When you stare at a triangle problem, use this mental checklist to pick the right tool:
- Do I have SAS (Side-Angle-Side)? → Law of Cosines (find the third side, then switch to Law of Sines for angles).
- Do I have SSS (Side-Side-Side)? → Law of Cosines (find the largest angle first—opposite the longest side—to avoid acute/obtuse ambiguity).
- Do I have ASA, AAS, or SSA? → Law of Sines (but pause for the SSA ambiguous case check).
- Is it a right triangle? → SOH CAH TOA / Pythagorean Theorem (fastest route).
Pro tip: If you use the Law of Cosines to find an angle via $\cos C = \frac{a^2 + b^2 - c^2}{2ab}$, the sign of the result tells you everything: positive $\rightarrow$ acute (${content}lt;90^\circ$), zero $\rightarrow$ right, negative $\rightarrow$ obtuse (${content}gt;90^\circ$). No quadrant guessing required.
Beyond the Textbook: Where It Actually Shows Up
- Navigation & GPS: Trilateration—determining position by measuring distances to known satellites—relies on solving systems of cosine-law equations in three dimensions (spherical law of cosines).
- Computer Graphics & Robotics: Inverse kinematics (calculating joint angles to place a robotic hand at a specific coordinate) is essentially a chain of Law of Cosines problems.
- Physics (Vector Addition): The magnitude of the resultant vector $\vec{R} = \vec{A} + \vec{B}$ is $R = \sqrt{A^2 + B^2 + 2AB\cos\theta}$. That plus* sign appears because the angle between vectors is the supplement of the triangle's interior angle—a subtle but critical distinction.
- Surveying: Measuring the distance across a lake or canyon by establishing a baseline and measuring angles to the far shore.
Summary Cheat Sheet
| Known Info | Goal | Primary Tool | Watch Out For |
|---|---|---|---|
| SAS | Missing side | Law of Cosines (direct) | Calculator mode (deg/rad) |
| SAS | Missing angles | Law of Cosines $\rightarrow$ Law of Sines | Rounding error propagation |
| SSS | Largest angle | Law of Cosines (solve for $\cos$) | Sign of cosine = angle type |
| SSS | Other angles | Law of Sines (after largest) | Ambiguity (acute vs. obtuse) |
| SSA | Any | Law of Sines | Two possible triangles (or zero) |
The Law of Cosines is more than a formula to memorize for a test; it is the algebraic bridge between linear distances and angular relationships. It generalizes the Pythagorean theorem to the entire universe of triangles, handles the obtuse cases that right-triangle trigonometry cannot reach, and provides the computational backbone for everything from satellite orbits to the animation of a video game character’s elbow. Master the included-angle requirement, respect the SSA ambiguity, and you possess a tool that turns any triangle—no matter how skewed—into a solvable system of numbers.
Latest Posts
Fresh Stories
-
What Are Coefficients In Chemical Equations
Aug 08, 2026
-
What Are The Four Major Types Of Biomolecules
Aug 08, 2026
-
What Is The Longest Phase Of Mitosis
Aug 08, 2026
-
How To Find Area Of Arc
Aug 08, 2026
-
What Is The Molecular Geometry Of Carbon Dioxide
Aug 08, 2026
Related Posts
These Fit Well Together
-
Which Is A Non Membrane Bound Organelle
Aug 01, 2026
-
How To Solve For Limiting Reagent
Aug 01, 2026
-
How Many Electrons In The F Orbital
Aug 01, 2026
-
Length Of Segment Of Circle Formula
Aug 01, 2026
-
What Type Of Tissue Is Avascular
Aug 01, 2026