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 rule: ask one question. Do you know an angle and the side directly opposite it? If yes, use the Law of Sines: you have a matching pair to build a ratio from. If no, use the Law of Cosines: there is no ratio to start from.
Decision chart: Law of Sines or Law of Cosines Ask whether you know an angle and the side directly opposite it. If yes, use the Law of Sines for AAS, ASA or SSA. If no, use the Law of Cosines for SAS or SSS. Do you know an angle and the side directly opposite it? Yes No Law of Sines AAS · ASA · SSA With SSA, check for a second triangle Law of Cosines SAS · SSS No matching pair, so no ratio to start from

The same rule in triangle shorthand:

What you knowCaseMatching pair?Use
Two angles + any sideAAS or ASAYes (after finding the third angle)Law of Sines
Two sides + an angle that is not between themSSAYesLaw of Sines, but check for the ambiguous case
Two sides + the angle between themSASNoLaw of Cosines
All three sidesSSSNoLaw of Cosines
Three angles onlyAAANo side at allNeither: 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 < hNone (side a is too short to reach)
a = hOne (a right triangle)
h < a < bTwo
a ≥ bOne

If A is 90° or more, there is one triangle when a > b and none otherwise.

Worked example. A = 30°, a = 5, b = 8.

Switching to the Law of Cosines does not remove the ambiguity. With SSA, the cosine rule becomes a quadratic equation in the missing side. Here it is c² − 16·cos 30°·c + 39 = 0, with the two roots 9.93 and 3.93, one for each triangle.

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

  1. 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.)
  2. Using the Law of Sines when there is no matching pair. SAS and SSS need the Law of Cosines.
  3. Forgetting the ambiguous case. SSA can give two answers. If you found one, check for the second.
  4. Mixing up the included angle. In SAS, C must be the angle between sides a and b. Label the triangle first.
  5. 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?

  1. A = 50°, B = 60°, a = 10. Find b.
  2. a = 9, b = 12, included angle C = 40°. Find c.
  3. Sides 6, 8 and 10. Find the largest angle.
  4. A = 35°, a = 7, b = 9. How many triangles?
  5. A = 25°, C = 70°, b = 12. Find a.
  6. A = 40°, a = 5, b = 10. How many triangles?
Show the answers
  1. Law of Sines (angle–side pair A and a): b = 10 × sin 60° / sin 50° ≈ 11.31
  2. Law of Cosines (SAS): c² = 81 + 144 − 216·cos 40° ≈ 59.53, so c ≈ 7.72
  3. 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.
  4. 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).
  5. Law of Sines (ASA): B = 85°, so a = 12 × sin 25° / sin 85° ≈ 5.09
  6. Law of Sines (SSA): sin B = 10 × sin 40° / 5 ≈ 1.286, which is more than 1, so no triangle exists.
Need a calculator for class? The TI-84 Plus CE is one of the most widely used graphing calculators for trigonometry, precalculus, and calculus coursework. View on Amazon →
As an Amazon Associate, MathInSite earns from qualifying purchases.

Frequently Asked Questions

  1. 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.

  2. 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.

  3. 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.

  4. 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.

  5. 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.

  6. 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.

← Browse all free math calculators