1. The problem with non-right triangles
The trig you first meet — $\sin$, $\cos$, $\tan$ as "opposite over hypotenuse" and so on — is defined for a right triangle. Pick a non-right angle, name its opposite side, its adjacent side, and the hypotenuse, and the ratios fall out. That definition is precise and it works. It also has a glaring limitation: most triangles in the world aren't right triangles.
If you only know two sides and an included angle of an oblique (non-right) triangle, none of the basic ratios apply. There is no "hypotenuse" to divide by. The Pythagorean theorem similarly fails — $a^2 + b^2$ does not equal $c^2$ unless the angle between $a$ and $b$ is exactly $90°$.
What we need is two generalizations: one that ties each side to its opposite angle, and one that recovers $c^2$ from $a$, $b$, and the angle between them. These are the Law of Sines and the Law of Cosines. Together, they're enough to solve any triangle from any three pieces of information that actually determine one.
Naming convention
Throughout this page we use the standard labelling: angles are capital ($A$, $B$, $C$) and the side opposite each angle gets the matching lowercase letter ($a$, $b$, $c$). Side $a$ sits across from angle $A$ — it does not touch $A$ at all. The same goes for $b$ and $B$, $c$ and $C$.
A triangle has six pieces of information: three sides and three angles. To pin one down you typically need three of those six — and at least one has to be a side, otherwise you only know the shape, not the size. Every "given" pattern (ASA, AAS, SAS, SSA, SSS) is just three of the six. The two laws are the tools that finish the other three.
2. The Law of Sines
For any triangle with angles $A$, $B$, $C$ and opposite sides $a$, $b$, $c$:
$$ \frac{\sin A}{a} \;=\; \frac{\sin B}{b} \;=\; \frac{\sin C}{c} $$Equivalently, $\dfrac{a}{\sin A} = \dfrac{b}{\sin B} = \dfrac{c}{\sin C}$ — pair each side with the sine of its opposite angle, and the ratio is the same throughout the triangle.
The Law of Sines pairs sides with their opposite angles. The shared ratio is a property of the whole triangle (geometrically, it equals the diameter of the triangle's circumscribed circle — a fact worth knowing once but rarely needed in computation).
Reach for it when your three given pieces include a matched angle-side pair plus one more piece. The patterns that fit are:
- ASA — two angles and the side between them.
- AAS — two angles and a side that is not between them.
- SSA — two sides and an angle opposite one of them. This is the famous "ambiguous case" — see §5.
In each pattern, the known angle-side pair fixes the ratio. Then any other known angle or side lets you solve for its partner. For example, if you know $A$, $a$, and $B$, you compute $b = \dfrac{a \sin B}{\sin A}$.
The three angles of a triangle add to $180°$. If two angles are given, you immediately know the third by subtraction — no trigonometry needed. ASA and AAS problems usually start with $C = 180° - A - B$.
3. The Law of Cosines
For any triangle with angles $A$, $B$, $C$ and opposite sides $a$, $b$, $c$:
$$ \begin{aligned} a^2 &= b^2 + c^2 - 2bc\cos A \\ b^2 &= a^2 + c^2 - 2ac\cos B \\ c^2 &= a^2 + b^2 - 2ab\cos C \end{aligned} $$The three statements are the same identity rotated around the triangle. In each, the side on the left is opposite the angle on the right.
Read the third form carefully: $c^2$ equals the Pythagorean answer $a^2 + b^2$, minus a correction term that depends on the angle between $a$ and $b$. When that angle is $90°$ the correction vanishes, because $\cos 90° = 0$, and you recover the Pythagorean theorem exactly. When the angle is less than $90°$, $\cos C$ is positive and $c$ is shorter than the right-triangle answer. When it is more than $90°$, $\cos C$ is negative, the correction adds back in, and $c$ is longer. The Law of Cosines is the right generalization.
The Law of Cosines is the Pythagorean theorem with a correction term that knows what angle you actually have.
Reach for it when your three given pieces don't include a matched angle-side pair:
- SAS — two sides and the angle between them. Plug straight in; the formula spits out the third side.
- SSS — all three sides. Solve any of the three forms for $\cos$ of the angle you want: e.g. $\cos C = \dfrac{a^2 + b^2 - c^2}{2ab}$.
Rearranged for the angle
When you know all three sides and want an angle, solve algebraically for the cosine:
$$ \cos C \;=\; \frac{a^2 + b^2 - c^2}{2ab} $$Then $C = \arccos\!\left(\dfrac{a^2 + b^2 - c^2}{2ab}\right)$. Because $\arccos$ returns a unique angle in $[0°, 180°]$ — exactly the range a triangle's angle can occupy — the Law of Cosines route to an angle is never ambiguous, unlike the Law of Sines.
4. Choosing which law
The choice is mechanical once you classify what you're given. Translate the three known pieces into the standard pattern, then read off the row.
| Given | What it means | Use | Notes |
|---|---|---|---|
| ASA | Two angles and the side between them | Law of Sines | Find the third angle from the angle sum, then any side. |
| AAS | Two angles and a non-included side | Law of Sines | Same routine as ASA — third angle by subtraction, then sides. |
| SAS | Two sides and the angle between them | Law of Cosines | The opposite side comes out of one application of the formula. |
| SSS | All three sides | Law of Cosines | Use the angle-form $\cos C = \frac{a^2 + b^2 - c^2}{2ab}$ for each angle in turn. |
| SSA | Two sides and an angle opposite one of them | Law of Sines | Ambiguous — may give 0, 1, or 2 valid triangles. See §5. |
The Law of Sines connects a side to its opposite angle, so it only helps when you have such a matched pair. The Law of Cosines connects a side to the angle between the other two sides — perfect when the given pieces are arranged around a corner (SAS) or completely on the side-side-side ring (SSS).
One pattern is missing: AAA. Three angles alone fix the triangle's shape but not its size — there are infinitely many similar triangles with the same angles. No amount of trigonometry can recover the missing scale. You need at least one side.
5. The ambiguous case (SSA)
SSA — two sides and an angle opposite one of them — is the one configuration where the given information may not uniquely determine a triangle. Sometimes it specifies no triangle at all, sometimes one, and sometimes two. The geometry tells the story more clearly than the algebra.
Suppose you're given angle $A$, the side $b$ adjacent to it, and the side $a$ opposite. Set up the triangle by placing $A$ at the origin and laying side $b$ along one ray of the angle. The far end of $b$ is the unknown vertex $C$. Now you need to draw side $a$ from $C$ to land somewhere on the opposite ray. You don't know where on that ray — you only know the length of $a$.
So picture swinging side $a$ from $C$ like a compass:
- If $a$ is too short to reach the opposite ray at all, no triangle exists.
- If $a$ just touches the ray (tangent), there is exactly one triangle, and it is right-angled at the foot of $a$.
- If $a$ is long enough to reach but shorter than $b$, the swung arc crosses the ray at two distinct points — two different triangles satisfy the given data.
- If $a \geq b$, the arc only crosses the ray once on the correct side, giving one triangle.
Algebraically the two-solution case appears like this: solving $\sin B = \dfrac{b \sin A}{a}$ gives a value, say $\sin B = 0.7$. The equation $\sin B = 0.7$ has two solutions in $[0°, 180°]$: an acute one ($B \approx 44.4°$) and an obtuse one ($B \approx 135.6°$). Each yields a different third angle and therefore a different third side. Both are valid triangles, unless one would push $A + B$ past $180°$ — in which case that branch is rejected.
$\sin B = k$ never has just one solution in a triangle's angle range. It has two: $B$ and $180° - B$. Always check whether the obtuse branch is consistent with the rest of the triangle (does $A + B$ exceed $180°$?) before discarding it.
Worked summary of the SSA branches
Given angle $A$ and sides $a$ (opposite $A$) and $b$ (adjacent to $A$), let $h = b \sin A$ (the altitude from $C$ to the opposite ray). Then:
| Comparison | Number of triangles |
|---|---|
| $a < h$ | 0 (side too short) |
| $a = h$ | 1 (right triangle, tangent case) |
| $h < a < b$ | 2 (the ambiguous case proper) |
| $a \geq b$ | 1 |
6. Common pitfalls
"Opposite" means across from, not touching. Side $a$ does not touch angle $A$ at all — it lies on the far side of the triangle. A surprising number of wrong answers come from pairing $a$ with one of the angles at its endpoints instead of the angle facing it.
$c^2 = a^2 + b^2 - 2ab\cos C$ only collapses to $c^2 = a^2 + b^2$ when $C = 90°$ exactly. Forgetting the $-2ab\cos C$ correction in any other case will produce nonsense. The Pythagorean theorem is the boundary, not the default.
When the Law of Sines gives $\sin B = k$ in an SSA problem, the obtuse angle $180° - B$ is also a candidate. Take a moment to check whether $A + (180° - B) < 180°$ — if so, you have a second valid triangle and reporting only one is incomplete.
Calculators happily evaluate $\sin 30$ in radians (giving about $-0.99$) instead of degrees ($0.5$). If your answer is wildly off — especially negative when it should be positive, or vice versa — check the angle unit before re-deriving anything.
7. Worked examples
Sketch the triangle first, label what you know, decide which law fits, then compute. The sketch is doing real work — it's what stops you from pairing a side with the wrong angle.
Example 1 · SAS: find a side via Law of Cosines
Given $a = 8$, $b = 5$, and the included angle $C = 60°$. Find $c$.
Step 1. Pattern is SAS — two sides with the included angle. Use the Law of Cosines for the opposite side $c$.
$$ c^2 = a^2 + b^2 - 2ab\cos C $$Step 2. Substitute. With $\cos 60° = \tfrac{1}{2}$:
$$ c^2 = 64 + 25 - 2(8)(5)\!\left(\tfrac{1}{2}\right) = 89 - 40 = 49 $$Step 3. Take the positive square root (sides are positive):
$$ c = 7 $$Example 2 · SSS: find an angle via Law of Cosines
Given $a = 7$, $b = 8$, $c = 9$. Find angle $C$.
Step 1. Solve the Law of Cosines for $\cos C$:
$$ \cos C = \frac{a^2 + b^2 - c^2}{2ab} = \frac{49 + 64 - 81}{2(7)(8)} = \frac{32}{112} = \frac{2}{7} $$Step 2. Take the inverse cosine:
$$ C = \arccos\!\left(\tfrac{2}{7}\right) \approx 73.40° $$Because $\arccos$ returns a unique angle in $[0°, 180°]$, there is no ambiguity — this is the angle.
Example 3 · AAS: find a side via Law of Sines
Given $A = 40°$, $B = 75°$, and $a = 10$. Find $b$.
Step 1. Pattern is AAS — known angle-side pair $(A, a)$ plus another angle. Use the Law of Sines.
$$ \frac{b}{\sin B} = \frac{a}{\sin A} \;\Longrightarrow\; b = \frac{a \sin B}{\sin A} $$Step 2. Substitute:
$$ b = \frac{10 \sin 75°}{\sin 40°} \approx \frac{10 \cdot 0.9659}{0.6428} \approx 15.03 $$(Bonus: $C = 180° - 40° - 75° = 65°$ if you want to finish the triangle.)
Example 4 · SSA: the ambiguous case
Given $A = 30°$, $a = 6$, $b = 10$. Find angle $B$ and any valid triangles.
Step 1. Compute the altitude check: $h = b \sin A = 10 \cdot 0.5 = 5$. Since $h = 5 < a = 6 < b = 10$, we are in the two-triangle band.
Step 2. Apply the Law of Sines:
$$ \sin B = \frac{b \sin A}{a} = \frac{10 \cdot 0.5}{6} = \frac{5}{6} \approx 0.8333 $$Step 3. Solve $\sin B = 0.8333$. There are two candidates in $[0°, 180°]$:
$$ B_1 \approx 56.44°, \qquad B_2 = 180° - 56.44° \approx 123.56° $$Step 4. Check each for triangle consistency:
- Triangle 1: $A + B_1 = 30° + 56.44° = 86.44° < 180°$. Valid. Then $C_1 \approx 93.56°$.
- Triangle 2: $A + B_2 = 30° + 123.56° = 153.56° < 180°$. Also valid. Then $C_2 \approx 26.44°$.
Both triangles satisfy the given $A$, $a$, and $b$ — the data is genuinely ambiguous.
Example 5 · Sanity check: Law of Cosines at $C = 90°$ recovers Pythagoras
Take a right triangle with legs $a$ and $b$ and right angle at $C$. The Law of Cosines says:
$$ c^2 = a^2 + b^2 - 2ab\cos C $$Substitute $C = 90°$, so $\cos C = \cos 90° = 0$:
$$ c^2 = a^2 + b^2 - 2ab(0) = a^2 + b^2 $$That's the Pythagorean theorem. The Law of Cosines is therefore a strict generalization — Pythagoras is the special case where the angle between the two given sides happens to be $90°$. For any other angle, the $-2ab\cos C$ term is the correction that accounts for the triangle not being right.
As a concrete check: with $a = 3$, $b = 4$, $C = 90°$, we get $c^2 = 9 + 16 - 0 = 25$, so $c = 5$ — the familiar 3-4-5 right triangle.