Ever tried using the law of cosines on a triangle and wondered if you're allowed to? Like, is this thing only for the fancy ones, or can you slap it on anything with three sides and call it a day?
Here's the short version: yes, the law of cosines works for all triangles. Every single one. But the reason that answer feels too clean is because most people only meet this formula in a right-triangle context and then quietly assume it has boundaries it doesn't.
I know it sounds simple — but it's easy to miss why it actually holds up everywhere Simple, but easy to overlook..
What Is the Law of Cosines
The law of cosines is that slightly intimidating formula from trigonometry that relates the lengths of a triangle's sides to the cosine of one of its angles. In plain language, it lets you find a missing side or a missing angle when you don't have a right angle to lean on.
Most folks first see it written as:
c² = a² + b² − 2ab cos(C)
where a, b, and c are side lengths, and C is the angle opposite side c.
Not Just a Right-Triangle Tool
People hear "cosine" and flash back to SOH-CAH-TOA, which is all about right triangles. So it doesn't care if the triangle is right, acute, or obtuse. But the law of cosines is the generalization. It just works Simple, but easy to overlook..
Where It Comes From
If you're curious, it's basically the Pythagorean theorem with a correction factor. And when angle C is 90°, cos(90°) is 0, so that −2ab cos(C) term disappears and you're left with c² = a² + b². That's why that's the Pythagorean theorem. So the law of cosines is really what happens when you let the corner get weird It's one of those things that adds up..
Why It Matters
Why does this matter? Because most people skip the "does it work for all triangles" question and just hope they're using it correctly on a test or a real project.
In practice, you run into non-right triangles constantly. Figuring out the distance between two cell towers when you've measured the angles from a third point. In practice, building a roof. Plotting a property line. None of those are neat little 90° setups.
And here's what most people miss: if you think the law of cosines only applies to certain triangles, you'll either avoid using it when you should — or worse, force a right-triangle method onto a shape that doesn't fit and get a wrong answer that looks plausible Small thing, real impact..
Turns out, trusting that it works everywhere saves time and prevents quiet errors.
How It Works
The meaty part. Let's break down how and why the law of cosines functions for all triangles, and how you actually use it.
The Three Side-Length Version
The standard form finds a side when you know two sides and the included angle:
c² = a² + b² − 2ab cos(C)
You plug in a, b, and the angle C between them. Out comes c². Square root it, done Less friction, more output..
This works whether C is 30°, 90°, or 120°. Which means the cosine handles the sign. When C is obtuse, cos(C) is negative, so you're effectively adding instead of subtracting — which is exactly what a wide triangle needs Easy to understand, harder to ignore..
The Angle-Finding Version
Rearrange it and you can solve for an angle if you know all three sides:
cos(C) = (a² + b² − c²) / (2ab)
This is huge. Given three side lengths — any three that form a triangle — you can find any angle. That said, no right angle required. No guessing Simple, but easy to overlook..
Why It Holds for Acute Triangles
In an acute triangle, all angles are under 90°, so every cosine is positive. Day to day, the correction term shrinks the result compared to the Pythagorean sum, which matches the reality that the opposite side is shorter than it would be in a right setup. The math and the geometry agree.
Why It Holds for Obtuse Triangles
Now the interesting case. cos(110°) is negative. That's why which makes sense — push the angle past 90° and the opposite side stretches out. Say angle C is 110°. That −2ab cos(C) becomes a positive addition. So c² ends up larger than a² + b². The formula doesn't break; it adapts Practical, not theoretical..
Worth pausing on this one.
Why It Holds for Right Triangles
We touched on this, but it's worth saying plainly. At 90°, cosine is zero, the extra term vanishes, and you've got the Pythagorean theorem. So the right triangle isn't an exception — it's a special case that the law swallows whole.
A Quick Walkthrough
Imagine a triangle with sides a = 5, b = 7, and angle C = 60° between them And that's really what it comes down to..
c² = 25 + 49 − 2(5)(7)(0.5) c² = 74 − 35 = 39 c ≈ 6.24
Now imagine C = 120° instead. cos(120°) = −0.5.
c² = 25 + 49 − 2(5)(7)(−0.5) c² = 74 + 35 = 109 c ≈ 10.44
Same two sides, totally different third side. The law of cosines handled both without a hiccup.
Common Mistakes
It's the part most guides get wrong — they tell you the formula and bail. But the real errors happen in how people apply it.
Assuming It's Only for SAS
A lot of students think "law of cosines = side-angle-side only.You can bounce between sides and angles freely. That's why " Not true. Worth adding: the rearranged version solves angles from SSS (three sides). Limiting yourself to one case is leaving power on the table.
Mixing Up the Angle
The angle in the formula has to be the one opposite the side you're solving for. Here's the thing — put cos(A) in when you meant C and you'll get garbage. Real talk, this is the #1 slip I see.
Forgetting the Negative Cosine
When the angle is obtuse, people sometimes plug in the positive value of the cosine by habit. That flips the whole calculation. Worth knowing: if your angle is past 90°, the third side should be longer than the right-triangle version. If it isn't, you messed up the sign Practical, not theoretical..
Thinking Law of Sines Is More Universal
Ironically, the law of sines has more caveats (the ambiguous SSA case). The law of cosines is the more dependable workhorse for "all triangles" because it doesn't hit that same wall. But folks reach for sines first out of routine.
Practical Tips
Okay, so what actually works when you're sitting there with a triangle and a calculator?
Use It When You Know Two Sides and the Included Angle
That's the cleanest win. Don't drop a perpendicular and hack a right triangle out of it. Just use the formula. Faster, less error-prone It's one of those things that adds up..
Use the Rearranged Form for Three Sides
Measuring a plot of land and you've got all three boundary lengths? Find the corner angles with the cosine version. No need for extra survey points.
Check With the Extreme Case
If you're unsure your answer is sane, imagine the angle going to 0° or 180°. At 0°, the two sides fold together and c should approach |a − b|. At 180°, it approaches a + b. Day to day, the law of cosines respects those limits. If your output doesn't, you typed something wrong.
Keep Your Calculator in Degrees (or Know It Isn't)
Sounds dumb. Even so, it isn't. That said, half my own mistakes came from radian mode. The law of cosines doesn't care about your mode — but your cosine button does Practical, not theoretical..
Don't Fear the Obtuse
A triangle with a fat angle isn't broken. The formula knows what to do. Neither should you hesitate.
FAQ
Does the law of cosines work for right triangles?
Yes. When the angle is 90°, the cosine term becomes zero and the formula becomes the Pythagorean theorem. It's a special case, not an exception Nothing fancy..
Can you use the law of cosines on any triangle?
You can. Acute, obtuse, or right — if it has three sides and three angles, the law of cosines applies. You just
need to make sure you're using the version that matches the data you have. For side-solving, use the standard form; for angle-solving from three sides, flip it so the cosine sits alone on one side.
Is there a situation where law of sines is clearly better?
Sure. If you know two angles and one side (AAS or ASA), the law of sines gets you the rest in one or two clean steps without squaring anything. The law of cosines can do it too, but it's the scenic route. Use the right tool, not just the familiar one And that's really what it comes down to. And it works..
Conclusion
The law of cosines isn't a niche trick for one specific triangle setup — it's a general-purpose tool that covers side-solving, angle-solving, and every triangle shape in between. Most of the confusion around it comes from avoidable habits: mislabeling the angle, dropping the negative sign on obtuse cases, or defaulting to the law of sines out of routine. In practice, learn the two forms, respect your calculator's angle mode, and sanity-check against the straight-line limits. Do that, and you've got a method that won't bail on you when the triangle gets weird.