Law of Sines vs. Law of Cosines: When to Use Each
Law of Sines or Law of Cosines? One question settles it every time, and the rest of this page shows you how to use it, with worked examples for each triangle case and the one trap, the ambiguous case, that catches almost everyone.
The same rule in triangle shorthand:
| What you know | Case | Matching pair? | Use |
|---|---|---|---|
| Two angles + any side | AAS or ASA | Yes (after finding the third angle) | Law of Sines |
| Two sides + an angle that is not between them | SSA | Yes | Law of Sines, but check for the ambiguous case |
| Two sides + the angle between them | SAS | No | Law of Cosines |
| All three sides | SSS | No | Law of Cosines |
| Three angles only | AAA | No side at all | Neither: you get the shape but not the size, so the triangle can’t be solved |
The Law of Sines
a / sin A = b / sin B = c / sin C
Use it when you have a side and the angle across from it, plus one more measurement. Set up a proportion with the known pair and solve for the missing piece. If you know two angles, subtract from 180° to get the third first.
Worked example (AAS). A = 40°, B = 65°, a = 8. Find side b.
8 / sin 40° = b / sin 65°
b = 8 × sin 65° / sin 40° ≈ 8 × 0.9063 / 0.6428 ≈ 11.28
Check any answer with the Law of Sines Calculator.
The Law of Cosines
c² = a² + b² − 2ab·cos C
The angle form is cos C = (a² + b² − c²) / (2ab).
Use the side form for SAS: two sides and the angle between them give you the third side directly. Use the angle form for SSS: three sides give you any angle.
Worked example (SAS). a = 7, b = 10, included angle C = 60°. Find c.
c² = 7² + 10² − 2(7)(10)·cos 60° = 49 + 100 − 140(0.5) = 79
c = √79 ≈ 8.89
Worked example (SSS). Sides 5, 7 and 9. Find the largest angle, which is opposite the side of length 9.
cos C = (5² + 7² − 9²) / (2·5·7) = (25 + 49 − 81) / 70 = −7/70 = −0.1
C = cos⁻¹(−0.1) ≈ 95.7°
Check any answer with the Law of Cosines Calculator.
Why you can’t just swap them
Try the Law of Sines on the SAS triangle above. You know sides a and b and angle C. But angle C is opposite side c, the side you don’t know, and the sides you do know (a and b) are opposite angles you don’t know. There is no matching pair anywhere, so the proportion has no known ratio to anchor it. The same is true for SSS, where you know no angles at all.
The Law of Cosines doesn’t need a pair. It builds the missing side straight from two sides and the angle between them.
Most problems use both laws
Exercises usually ask you to solve the whole triangle. The smoothest route is to start with the law that fits, then finish with the other.
SAS, finished. Continue the example (a = 7, b = 10, C = 60°, c ≈ 8.89). You now have a matching pair (C and c), so switch to the Law of Sines for the next angle:
sin A = 7 × sin 60° / 8.89 ≈ 0.6821, so A ≈ 43.0°
B = 180° − 60° − 43.0° = 77.0°
Look for the angle opposite the shorter of the two known sides first. It must be acute, so there is no second answer to worry about.
SSS, finished. Continue the example (5, 7, 9). Find the largest angle first with the Law of Cosines (C ≈ 95.7°). Cosine returns the correct angle even when it is obtuse, while sine can’t tell an obtuse angle from its acute twin. Then use the Law of Sines on the others:
sin A = 5 × sin 95.7° / 9 ≈ 0.5528, so A ≈ 33.6°
B = 180° − 95.7° − 33.6° ≈ 50.7°
Sanity checks: the three angles add to 180°, and the largest angle sits opposite the longest side.
Watch out: the ambiguous case (SSA)
SSA is where the rule gets tricky. Two sides and a non-included angle can fit zero, one or two different triangles. The reason is that sin B = 0.8 is true for both 53.13° and 126.87°.
Test it with the height. For an acute angle A, with a opposite A and the other known side b, compute h = b·sin A and compare:
| If A is acute and… | Triangles |
|---|---|
| a < h | None (side a is too short to reach) |
| a = h | One (a right triangle) |
| h < a < b | Two |
| a ≥ b | One |
If A is 90° or more, there is one triangle when a > b and none otherwise.
Worked example. A = 30°, a = 5, b = 8.
- h = 8 × sin 30° = 4, and 4 < 5 < 8, so expect two triangles.
- sin B = 8 × sin 30° / 5 = 0.8, so B₁ = 53.13° and B₂ = 180° − 53.13° = 126.87°.
- Both fit, since 30° + 126.87° = 156.87° is under 180°.
- Triangle 1: C = 180° − 30° − 53.13° = 96.87°, so c = 5 × sin 96.87° / sin 30° ≈ 9.93
- Triangle 2: C = 180° − 30° − 126.87° = 23.13°, so c = 5 × sin 23.13° / sin 30° ≈ 3.93
Our Law of Sines Calculator solves both triangles for you and tells you when no triangle exists. For the full method, with five more worked examples and a practice set, read the ambiguous case of the Law of Sines.
Don’t confuse SAS and SSA. In SAS the angle is between the two sides, and there is always exactly one triangle. In SSA the angle is not between them, and that is the ambiguous one.
5 common mistakes
- Calculator in the wrong angle mode. Match the mode to your units: degrees when the problem gives degrees, radians when it gives radians. A wrong mode is the most common reason an answer looks like nonsense. (Check values with the trig functions calculator.)
- Using the Law of Sines when there is no matching pair. SAS and SSS need the Law of Cosines.
- Forgetting the ambiguous case. SSA can give two answers. If you found one, check for the second.
- Mixing up the included angle. In SAS, C must be the angle between sides a and b. Label the triangle first.
- Rounding too early. Carry the full calculator value through the steps and round only the final answer.
Test yourself: which law, and what’s the answer?
- A = 50°, B = 60°, a = 10. Find b.
- a = 9, b = 12, included angle C = 40°. Find c.
- Sides 6, 8 and 10. Find the largest angle.
- A = 35°, a = 7, b = 9. How many triangles?
- A = 25°, C = 70°, b = 12. Find a.
- A = 40°, a = 5, b = 10. How many triangles?
Show the answers
- Law of Sines (angle–side pair A and a): b = 10 × sin 60° / sin 50° ≈ 11.31
- Law of Cosines (SAS): c² = 81 + 144 − 216·cos 40° ≈ 59.53, so c ≈ 7.72
- Law of Cosines (SSS): cos C = (36 + 64 − 100) / 96 = 0, so C = 90°. It’s a right triangle, so the Law of Cosines just handed you the Pythagorean theorem.
- Law of Sines (SSA): sin B ≈ 0.7375, giving B ≈ 47.5° or 132.5°. Both fit, so two triangles (c ≈ 12.10 or c ≈ 2.64).
- Law of Sines (ASA): B = 85°, so a = 12 × sin 25° / sin 85° ≈ 5.09
- Law of Sines (SSA): sin B = 10 × sin 40° / 5 ≈ 1.286, which is more than 1, so no triangle exists.
As an Amazon Associate, MathInSite earns from qualifying purchases.
Frequently Asked Questions
-
How do I remember which law to use?
Ask whether you know an angle and the side opposite it. If yes, use the Law of Sines. If no, use the Law of Cosines.
-
Can I use the Law of Sines when I know SAS?
No. In SAS the known angle is opposite the side you don't know, so there is no matching angle-side pair to build a proportion from. Use the Law of Cosines first, then switch to sines to finish the triangle.
-
Which law do I use if I know all three sides (SSS)?
The Law of Cosines, in its angle form. Find the largest angle first, then use either law for the rest.
-
What is the ambiguous case?
When you know SSA (two sides and a non-included angle), the measurements can fit zero, one or two triangles. Compute h = b sin A and compare it with a to find out which.
-
Is the Law of Cosines related to the Pythagorean theorem?
Yes, it generalizes it. When C = 90 degrees, cos C = 0 and the formula becomes c squared = a squared + b squared.
-
Does it matter which side I call a, b or c?
Only that each angle is paired with the side opposite it: A with a, B with b and C with c.
Keep going: the Law of Sines Calculator and Law of Cosines Calculator show every step, the Pythagorean theorem calculator handles right triangles, and the geometry formulas cheat sheet collects the rest.
Every worked example on this page was checked by independent calculation. Last reviewed October 2026.