Law of Sines vs Law of Cosines: Which One to Use
Once a triangle loses its right angle, SOHCAHTOA stops working — those ratios were built on the presence of a 90° corner. Two more general tools take over for any triangle at all: the Law of Sines and the Law of Cosines. The real skill is not memorising them but knowing which one the problem is asking for, and that comes down to reading the information you are given.
The two laws stated
Throughout, a lowercase letter is the side directly across from the uppercase angle of the same letter, so side a faces angle A, and so on.
The Law of Sines links each side to the sine of its opposite angle:
a / sin A = b / sin B = c / sin C
The Law of Cosines generalises the Pythagorean theorem to any angle:
c2 = a2 + b2 − 2ab × cos C
When C is exactly 90°, cos C is 0 and the last term vanishes, leaving plain old a2 + b2 = c2. The Law of Cosines is really Pythagoras with a correction term for the angle.
Which law fits your triangle
The deciding question is whether you already have a matched pair — an angle and the side opposite it.
- Reach for the Law of Sines when you can form such a pair: the cases ASA, AAS, and SSA.
- Reach for the Law of Cosines when you cannot: the cases SAS (two sides and the angle between them) and SSS (all three sides).
A quick way to remember it: if you are handed all three sides, or two sides hugging an angle, no ratio pairs up cleanly, so cosines it is. Anything looser usually pairs an angle with its side, so sines does the job.
It helps to think of the two laws as covering opposite ends of "how much you already know." The Law of Sines thrives when an angle and its own opposite side are both sitting in front of you, because the ratio a/sin A only needs that one matched pair to unlock the rest of the triangle. The Law of Cosines is built for the opposite situation, where every piece of information is tangled together — either three sides with no angle at all, or two sides squeezed around a single angle that is not paired with either of them.
The ambiguous case, briefly
The SSA arrangement — two sides and an angle not tucked between them — is the tricky one, and it is the single most common source of "my answer doesn't match the textbook" complaints in this part of trigonometry. Depending on the numbers it can describe two different triangles, exactly one, or none at all. The root cause is that the Law of Sines only ever hands back an angle between 0° and 90° from an inverse sine, yet the true angle you are looking for might just as easily be its obtuse supplement — because sin θ and sin(180° − θ) are always equal. Whenever you apply the Law of Sines to SSA, check whether that second, obtuse candidate also leaves room for a valid third angle; if it does, you have two genuinely different triangles that both fit the same three given numbers.
A decision table for the five cases
Triangle problems are traditionally sorted into five letter-codes describing what you are given, and each one has a single correct starting law:
| Given | Meaning | Start with |
|---|---|---|
| ASA | Two angles and the side between them | Law of Sines |
| AAS | Two angles and a side not between them | Law of Sines |
| SAS | Two sides and the included angle | Law of Cosines |
| SSS | All three sides | Law of Cosines |
| SSA | Two sides and a non-included angle | Law of Sines (ambiguous) |
ASA and AAS behave identically once you notice that knowing two angles hands you the third for free (they sum to 180°), so either way you end up with at least one full angle-side pair to feed the Law of Sines. SSA also uses the Law of Sines first, but earns its own warning label because the arithmetic can quietly produce two different valid triangles instead of one — more on that below.
Where the Law of Cosines comes from
The formula is not an arbitrary rule; it falls out of dropping a perpendicular height inside the triangle and applying the Pythagorean theorem twice. Picture triangle ABC with angle C at the origin, side b running along the x-axis to vertex A, and vertex B rising off the axis. Vertex B then sits at coordinates (a cos C, a sin C), since a is the distance from C to B. Vertex A sits at (b, 0). The distance formula between those two points gives side c:
c2 = (b − a cos C)2 + (a sin C)2 = b2 − 2ab cos C + a2cos2C + a2sin2C.
Since sin2C + cos2C = 1 by the Pythagorean identity, the last two terms collapse to a2, leaving c2 = a2 + b2 − 2ab cos C exactly as stated earlier. Seeing the derivation makes the 90° special case obvious too: when C = 90°, cos C = 0 and the whole correction term vanishes on its own, without needing to memorise that fact separately.
Worked example 1: Law of Sines
In a triangle, angle A = 40°, angle B = 60°, and the side opposite A is a = 10. Find side b. You have angle A paired with side a, so the Law of Sines applies:
b = a × sin B / sin A = 10 × sin 60° / sin 40° = 10 × 0.8660 / 0.6428 ≈ 13.47.
Worked example 2: Law of Cosines
Now take a triangle with sides a = 5 and b = 7 and the included angle C = 60° between them. This is SAS, so use the Law of Cosines to find side c:
c2 = 52 + 72 − 2 × 5 × 7 × cos 60° = 25 + 49 − 70 × 0.5 = 74 − 35 = 39.
So c = √39 ≈ 6.24.
Finishing what you started
Notice that a single law rarely finishes a triangle on its own. After the Law of Cosines hands you side c above, the fastest next step is usually the Law of Sines to chase down a remaining angle, since you now have the paired side and angle it needs. The two laws work as a relay team: cosines to break into an awkward triangle, sines to mop up the rest.
The Law of Cosines is also the tool for the pure SSS case. Rearranged as cos C = (a2 + b2 − c2) / (2ab), it turns three known sides directly into an angle, with no ambiguity to worry about. That freedom from the two-triangle trap is one more reason to prefer cosines whenever a matched pair is missing.
Worked example 3: SSS, three sides and nothing else
Take a triangle with sides a = 8, b = 10, and c = 13, and no angle given at all. There is no side-angle pair to exploit, so the Law of Cosines has to go first, solved for whichever angle you want. For angle A, opposite side a:
cos A = (b2 + c2 − a2) / (2bc) = (100 + 169 − 64) / (2 × 10 × 13) = 205 / 260 ≈ 0.7885,
so A = cos−1(0.7885) ≈ 37.96°. The same rearrangement for B gives B ≈ 50.25°, and since the three angles of any triangle sum to 180°, C = 180° − 37.96° − 50.25° ≈ 91.79°. Only after all three sides are already accounted for does an angle emerge — there was never a matched pair to hand the Law of Sines in the first place.
Why the tool picks a method for you
The Law of Sines & Cosines Calculator looks at exactly the pattern described above — which sides and angles you filled in, and whether any known angle sits opposite a known side — and picks ASA/AAS, SAS, SSS, or SSA automatically, the same decision this article walks through by hand. It is worth doing the classification yourself at least a few times, though, because recognising the pattern at a glance is what makes triangle problems fast instead of a hunt through formulas.
Area also comes along once a triangle is solved: with two sides and the angle between them known, area = ½ab sin C works for any triangle, not just right ones, which is why it shows up as a byproduct of both the SAS and SSS calculations above rather than needing a separate formula.
Two of the five cases deserve their own deeper look. The SSA case can secretly hide a second valid triangle, which is involved enough to earn its own article: see The Law of Sines and the Ambiguous SSA Case. And the Law of Cosines itself — where it comes from geometrically, and exactly why it reduces to Pythagoras at 90° — gets a full derivation in The Law of Cosines: Derivation and When to Prefer It.
With the right law chosen, the arithmetic is short every time. Try both on your own triangles with the calculators on SinCosTan.