How to Solve a Triangle: SSS, SAS, ASA, AAS and SSA
Find every missing side and angle with just three tools: the angle sum, the law of sines and the law of cosines. Worked examples for each case, including the ambiguous one with two answers.
"Solving a triangle" means finding all of its missing sides and angles from the few you already know. It comes up in homework, of course, but also when you are laying out a garden bed, checking a roof pitch, or working out the length of a diagonal brace. The good news is that you only ever need three tools: the angle sum, the law of sines and the law of cosines. This guide shows which one to use for each situation, with worked examples, including the tricky case that can have two answers.
Naming the parts
The usual convention labels the angles with capital letters A, B and C, and the sides with lowercase a, b and c. Each side is named after the angle opposite it: side a faces angle A, and so on. Getting this pairing right is half the battle, because both laws depend on it.
To fix a triangle's shape and size you need three values, and at least one of them must be a side. Three angles alone only fix the shape: a small triangle and a large one can share the same angles.
The three tools
- Angle sum: A + B + C = 180°. If you know two angles, you know the third.
- Law of sines: a / sin A = b / sin B = c / sin C. Use it when you know a side and the angle opposite it.
- Law of cosines: c² = a² + b² − 2ab × cos C. Use it when you know two sides and the angle between them, or all three sides.
The law of cosines is the Pythagorean theorem with a correction term. When C is 90°, cos C is 0 and it becomes c² = a² + b².
Which case are you in?
The five combinations of three known values have short names, read in order around the triangle (S for side, A for angle):
- SSS: three sides. Use the law of cosines for two angles, then the angle sum.
- SAS: two sides and the angle between them. Use the law of cosines for the third side.
- ASA: two angles and the side between them. Use the angle sum, then the law of sines.
- AAS: two angles and a side that is not between them. Same as ASA.
- SSA: two sides and an angle that is not between them. Use the law of sines, but be careful: there may be zero, one or two triangles.
Worked example 1: three sides (SSS)
Sides a = 7, b = 9 and c = 12.
- Check that the triangle exists. The longest side, 12, must be shorter than the other two together: 7 + 9 = 16, so it is.
- Angle A: cos A = (b² + c² − a²) / (2bc) = (81 + 144 − 49) / 216 = 176 / 216 ≈ 0.8148, so A ≈ 35.43°.
- Angle B: cos B = (a² + c² − b²) / (2ac) = (49 + 144 − 81) / 168 = 112 / 168 ≈ 0.6667, so B ≈ 48.19°.
- Angle C: 180° − 35.43° − 48.19° ≈ 96.38°.
- Area with Heron's formula: s = (7 + 9 + 12) / 2 = 14, and area = √(14 × 7 × 5 × 2) = √980 ≈ 31.30.
Because C is over 90°, this is an obtuse triangle. A quick check: the largest angle always faces the longest side, and here C faces the side of 12.
Worked example 2: two angles and a side (ASA)
Angles A = 35° and B = 65°, with the side between them c = 20. This is the typical surveying situation: you measure a baseline and the angles from each end to a far point.
- Angle C: 180° − 35° − 65° = 80°.
- Side a: a = c × sin A / sin C = 20 × sin 35° / sin 80° ≈ 11.65.
- Side b: b = c × sin B / sin C = 20 × sin 65° / sin 80° ≈ 18.41.
The ambiguous case (SSA)
Suppose you know a = 6, b = 9 and angle A = 30°. The law of sines gives sin B = b × sin A / a = 9 × 0.5 / 6 = 0.75.
Two angles have a sine of 0.75: B ≈ 48.59° and B ≈ 180° − 48.59° = 131.41°. Both leave room for a positive third angle, so two different triangles fit:
- Triangle 1: B ≈ 48.59°, C ≈ 101.41°, c ≈ 11.76, area ≈ 26.47
- Triangle 2: B ≈ 131.41°, C ≈ 18.59°, c ≈ 3.83, area ≈ 8.61
Picture side a as a stick hinged at the far end of side b. Swing it toward the line that side c lies on and it can touch that line at two points. Change the length of side a and the picture changes:
- a = 4: sin B would be 1.125, which is impossible, so no triangle exists. Side a is too short to reach that line; it needs to be at least b × sin A = 4.5.
- a = 4.5: sin B is exactly 1, so B = 90° and there is exactly one right triangle.
- a = 10: sin B = 0.45, giving B ≈ 26.74°. The other option, 153.26°, would push A + B past 180°, so only one triangle fits.
How the included angle changes the area
With two sides fixed, the area is ½ × a × b × sin C, so it depends entirely on the angle between them. For sides of 6 and 9, the area is largest at 90°, where it reaches 27, and shrinks symmetrically toward 0 as the angle flattens toward 0° or 180°. That is why the two SSA triangles above have such different areas even though they share two sides.

How to use the Triangle Calculator
Pick the case that matches what you know (SSS, SAS, ASA, AAS or SSA), fill in the three boxes that appear and press Solve. The results list every side and angle, the area, the perimeter and the triangle type, such as "Scalene, obtuse". The details panel names the law used and shows each substitution step, so you can follow or check your own working. In the SSA case, if two triangles fit, both are shown side by side.
Common mistakes
- Mismatched labels. In the law of sines, each side must be paired with the angle opposite it, not next to it.
- Calculator in radians. If sin 30° comes out as −0.988, your calculator is in radian mode. Angles here are in degrees.
- Missing the second SSA solution. A calculator's inverse sine only returns angles up to 90°. Always check whether 180° minus that angle also works.
- Rounding too early. Keep full precision until the last step, or small errors pile up in the third side and the area.
- Mixing units. Use one length unit for all sides; the area is then in that unit squared.
FAQ
Can I use the Pythagorean theorem for any triangle?
Only for right triangles. For any other triangle, use the law of cosines, which includes the extra term that corrects for the angle not being 90°.
How do I know if three lengths can form a triangle?
Check the triangle inequality: the longest side must be shorter than the sum of the other two. Lengths of 3, 4 and 8 fail because 3 + 4 is only 7.
Why does the largest angle face the longest side?
The wider an angle opens, the farther apart the ends of its two sides are, so the side across from it is longer. As a result, the sides of a triangle always rank in the same order as their opposite angles.
When should I use the law of sines instead of the law of cosines?
Use the law of sines when you know a side together with its opposite angle. Use the law of cosines when you do not, which is the case for SSS and SAS.