A triangle has six measurements: three sides and three angles. Usually you know three of them, and the job is to find the rest. The hard part is not the algebra. It is deciding which law to use first, and noticing when the data allows two different triangles.
This guide is a map for that decision. The solver below handles all five cases of known measurements, draws the triangle to scale and shows every step. If you want the proof of each law on its own, see our articles on the law of sines and the law of cosines; here we focus on choosing and on the ambiguous case.
The two laws in one place
Label the triangle so that side $latex a$ is opposite angle $latex A$, side $latex b$ is opposite $latex B$ and side $latex c$ is opposite $latex C$. The law of sines says:
$$\frac{a}{\sin A}=\frac{b}{\sin B}=\frac{c}{\sin C}$$
The law of cosines says that, for any of the three sides:
$$a^2=b^2+c^2-2bc\cos A$$
Solved for the angle, it becomes $latex \cos A=\frac{b^2+c^2-a^2}{2bc}$. The other two versions follow by swapping the letters. When $latex A=90^{\circ}$, the cosine is 0 and you get the Pythagorean theorem back.
Which law do I use first?
Look at what you are given and match it to one row. The letters name the order of the data: S is a side, A is an angle.
| Given | Case | Start with | Reason |
|---|---|---|---|
| Three sides | SSS | Law of cosines | No angle is known yet, so there is no side-angle pair for the law of sines. |
| Two sides and the angle between them | SAS | Law of cosines | It gives the third side directly. |
| Two angles and the side between them | ASA | Angle sum, then law of sines | The third angle is $latex 180^{\circ}-A-B$, and now every side has an opposite angle. |
| Two angles and a side not between them | AAS | Angle sum, then law of sines | Same idea: find the third angle first. |
| Two sides and an angle not between them | SSA | Law of sines, with care | This is the ambiguous case: zero, one or two triangles. |
After the first step you can usually finish with either law. One safe habit: once you know a side, find the angle opposite the smaller of the two remaining sides with the law of sines. That angle is always acute, so the calculator's answer is the right one.
The ambiguous case (SSA)
Suppose you know angle $latex A$, the side $latex a$ opposite it, and the side $latex b$ next to it. Picture side $latex a$ as a rod hinged at the end of side $latex b$, swinging down toward the base line. It can miss the base, touch it, or cross it in two places. That is exactly what the solver shows in SSA mode: the dashed circle is the path of the rod.
The law of sines gives $latex \sin B=\frac{b\sin A}{a}$. A calculator returns only the acute angle for this sine, but the angle $latex 180^{\circ}-B$ has the same sine. So there can be a second triangle, and it exists whenever $latex A+(180^{\circ}-B)<180^{\circ}$.
To decide in advance, compare $latex a$ with the height $latex h=b\sin A$ when $latex A$ is acute:
| Condition on side a | Number of triangles |
|---|---|
| $latex a<b\sin A$ | None: the rod is too short to reach the base |
| $latex a=b\sin A$ | One, and it is a right triangle |
| $latex b\sin A<a<b$ | Two: one acute $latex B$ and one obtuse $latex B$ |
| $latex a\ge b$ | One: the obtuse option would push the angle sum past $latex 180^{\circ}$ |
If $latex A$ is right or obtuse, there is one triangle when $latex a>b$ and none otherwise. As a cross-check, the law of cosines turns the question into a quadratic in $latex c$, $latex c^2-2b\,c\cos A+b^2-a^2=0$, and the number of positive roots is the number of triangles.
Solving triangles: worked examples
Work each one on paper first. Keep at least four decimals in the middle steps and round only the final answers.
EXAMPLE 1
Solve the triangle with sides 7, 8 and 9 (SSS): $latex a=7$, $latex b=8$, $latex c=9$.
Solution
Three sides: use the law of cosines for two angles.
$$\cos A=\frac{8^2+9^2-7^2}{2\cdot 8\cdot 9}=\frac{96}{144}=0.6667\ \Rightarrow\ A=48.19^{\circ}$$
$$\cos B=\frac{7^2+9^2-8^2}{2\cdot 7\cdot 9}=\frac{66}{126}=0.5238\ \Rightarrow\ B=58.41^{\circ}$$
$$C=180^{\circ}-48.19^{\circ}-58.41^{\circ}=73.4^{\circ}$$
All three angles are known. The largest angle faces the longest side, as it should.
EXAMPLE 2
Solve the triangle with $latex b=10$, $latex c=14$ and the angle between them $latex A=60^{\circ}$ (SAS).
Solution
Two sides and the angle between them: the law of cosines gives the third side.
$$a^2=10^2+14^2-2\cdot 10\cdot 14\cos 60^{\circ}=296-140=156\ \Rightarrow\ a=12.49$$
Now find the angle opposite the shorter of the remaining sides, which is $latex b$, with the law of sines:
$$\sin B=\frac{10\sin 60^{\circ}}{12.49}=0.6934\ \Rightarrow\ B=43.9^{\circ}$$
$$C=180^{\circ}-60^{\circ}-43.9^{\circ}=76.1^{\circ}$$
EXAMPLE 3
Two lookouts stand 1000 m apart on a straight road. They sight the same fire at angles of 52° and 71° from the road, measured at each lookout between the road and the fire. How far is the fire from each lookout?
Solution
The angles are at lookouts $latex A$ and $latex B$, and the side between them is $latex c=1000$ (ASA).
$$C=180^{\circ}-52^{\circ}-71^{\circ}=57^{\circ}$$
$$b=\frac{1000\sin 71^{\circ}}{\sin 57^{\circ}}=1127.4\ \text{m},\qquad a=\frac{1000\sin 52^{\circ}}{\sin 57^{\circ}}=939.6\ \text{m}$$
The fire is 1127.4 m from lookout A and 939.6 m from lookout B.
EXAMPLE 4
A triangle has $latex A=30^{\circ}$, $latex a=7$ and $latex b=10$. Find all triangles that fit.
Solution
The angle is not between the sides (SSA), so check for the ambiguous case. The height is $latex h=10\sin 30^{\circ}=5$. Since $latex 5<7<10$, there are two triangles.
$$\sin B=\frac{10\sin 30^{\circ}}{7}=0.7143\ \Rightarrow\ B_1=45.58^{\circ}\ \text{or}\ B_2=180^{\circ}-45.58^{\circ}=134.42^{\circ}$$
Triangle 1: $latex C_1=180^{\circ}-30^{\circ}-45.58^{\circ}=104.42^{\circ}$ and $latex c_1=\frac{7\sin 104.42^{\circ}}{\sin 30^{\circ}}=13.56$.
Triangle 2: $latex C_2=180^{\circ}-30^{\circ}-134.42^{\circ}=15.58^{\circ}$ and $latex c_2=\frac{7\sin 15.58^{\circ}}{\sin 30^{\circ}}=3.76$.
Both triangles have the given angle and sides. Set the solver to SSA with its default values to see them together.
EXAMPLE 5
A triangle has $latex A=40^{\circ}$, $latex a=5$ and $latex b=10$. How many triangles fit?
Solution
The height is $latex h=10\sin 40^{\circ}=6.43$, which is greater than $latex a=5$. The rod is too short to reach the base.
$$\sin B=\frac{10\sin 40^{\circ}}{5}=1.2856>1$$
No angle has a sine greater than 1, so no triangle exists.
EXAMPLE 6
A triangle has $latex A=50^{\circ}$, $latex a=12$ and $latex b=9$. Solve it.
Solution
Here $latex a>b$, so we expect exactly one triangle.
$$\sin B=\frac{9\sin 50^{\circ}}{12}=0.5745\ \Rightarrow\ B=35.07^{\circ}$$
The obtuse option $latex 180^{\circ}-35.07^{\circ}=144.93^{\circ}$ fails, because with $latex A=50^{\circ}$ the angle sum would pass $latex 180^{\circ}$.
$$C=94.93^{\circ},\qquad c=\frac{12\sin 94.93^{\circ}}{\sin 50^{\circ}}=15.61$$
Common mistakes
- Calculator in the wrong mode. Angles in degrees need degree mode; one slip changes every answer.
- Forgetting the second triangle in SSA. Whenever the data is two sides and a non-included angle, test the obtuse option $latex 180^{\circ}-B$.
- Using the law of sines when no side and its opposite angle are known, as in SSS and SAS. Start with the law of cosines there.
- In SAS, finding the largest angle first with the law of sines. Find the angle opposite the smaller side first, because it is always acute.
- Dropping the sign in the law of cosines. For an obtuse angle, $latex \cos A$ is negative, so $latex -2bc\cos A$ adds to the sum.
- Rounding too early, so the three angles no longer add up to $latex 180^{\circ}$.
Solving triangles: practice problems
Decide the case first, then the law. Open each answer to compare.
1. Solve the triangle with sides 5, 6 and 7. Give each angle.
Answer
SSS, so use cosines: $latex A=44.42^{\circ}$, $latex B=57.12^{\circ}$ and $latex C=78.46^{\circ}$.
2. Solve the triangle with $latex b=8$, $latex c=5$ and $latex A=120^{\circ}$.
Answer
SAS: $latex a=11.36$, then $latex B=37.59^{\circ}$ and $latex C=22.41^{\circ}$. The angle opposite the smaller side $latex c$ is found first.
3. Solve the triangle with $latex A=48^{\circ}$, $latex B=71^{\circ}$ and $latex a=15$.
Answer
AAS: $latex C=61^{\circ}$, $latex b=19.08$ and $latex c=17.65$.
4. A triangle has $latex A=35^{\circ}$, $latex a=8$ and $latex b=12$. Find all solutions.
Answer
Two triangles, since $latex h=6.88<8<12$. First: $latex B=59.36^{\circ}$, $latex C=85.64^{\circ}$, $latex c=13.91$. Second: $latex B=120.64^{\circ}$, $latex C=24.36^{\circ}$, $latex c=5.75$.
5. A triangle has $latex A=42^{\circ}$, $latex a=9$ and $latex b=5$. Solve it.
Answer
One triangle, because $latex a>b$: $latex B=21.82^{\circ}$, $latex C=116.18^{\circ}$ and $latex c=12.07$.
6. Is there a triangle with $latex A=65^{\circ}$, $latex a=8$ and $latex b=10$?
Answer
No. The height is $latex h=10\sin 65^{\circ}=9.06$, which is greater than 8, so side a cannot reach the base.
Frequently asked questions
Can I use the law of cosines for everything?
Yes, with more algebra. It solves SSS and SAS directly, and for SSA it becomes a quadratic in the missing side. The law of sines is shorter when you already have a side with its opposite angle.
How can I tell if a triangle from SSS is obtuse?
Look at the longest side. If its square is larger than the sum of the squares of the other two, the opposite angle is obtuse, and its cosine comes out negative.
Do these laws work for right triangles?
Yes. With $latex C=90^{\circ}$ the law of cosines becomes $latex c^2=a^2+b^2$ and the law of sines gives the usual sine ratios.
Why do SSS, SAS, ASA and AAS give one triangle but SSA may not?
Because in SSA the given angle is not enclosed by the two given sides, so the free side can swing and hit the base in two places.
Related calculators
Check your work with these tools:
See also
More on the laws of sines and cosines: