How to Solve Any Triangle: Law of Sines, Law of Cosines and SSA

Learn which rule to use for SSS, SAS, ASA, AAS and SSA triangles, with worked law of sines and cosines examples and a clear guide to the ambiguous case.

Updated September 29, 2026 7 min read

Use the free Triangle CalculatorSolve any triangle from three values, including the SSA ambiguous case

"Solving a triangle" means finding all three sides and all three angles from the few that you know. Surveyors, engineers and trigonometry students all do it. Right triangles have Pythagoras and SOH-CAH-TOA; every other triangle needs two more tools: the law of sines and the law of cosines.

This guide explains which three measurements are enough, which law to use for each combination, how to work through each case, and why one combination (two sides and a non-included angle) can give zero, one or two different triangles. All examples were checked with our calculator.

Labelling a triangle

The standard convention: angles are capital letters A, B, C, and the side opposite each angle is the matching lower-case letter. So side a is opposite angle A. Keeping to this convention is half the battle, because both laws pair each side with its opposite angle.

Two facts are always available:

  • The angles add up to 180°: A + B + C = 180°.
  • Each side is shorter than the other two combined (the triangle inequality). Sides 2, 3 and 6 cannot form a triangle.

The two laws

Law of sines: each side divided by the sine of its opposite angle gives the same number.

a / sin A = b / sin B = c / sin C

Law of cosines: a generalised Pythagoras that includes the angle between two sides.

a² = b² + c² − 2bc cos A

When A = 90°, cos A = 0 and the law of cosines becomes a² = b² + c². For right triangles alone, the Pythagorean Theorem Calculator is quicker.

Which rule for which case

Known Meaning First step
SSS Three sides Law of cosines for an angle
SAS Two sides and the angle between them Law of cosines for the third side
ASA Two angles and the side between them Third angle from 180°, then law of sines
AAS Two angles and a side not between them Third angle from 180°, then law of sines
SSA Two sides and an angle not between them Law of sines, then check for two solutions

Three angles alone (AAA) are not enough: they fix the shape but not the size.

SSS: three sides

Example: a = 5, b = 6, c = 7. Rearrange the law of cosines to find an angle:

cos A = (b² + c² − a²) ÷ 2bc = (36 + 49 − 25) ÷ 84 = 0.7143
A ≈ 44.42°

Repeat for B (≈ 57.12°), and C = 180° − A − B ≈ 78.46°.

For the area with three sides, Heron's formula avoids angles altogether. With s = (a + b + c)/2 = 9:

Area = √(s(s − a)(s − b)(s − c)) = √(9 × 4 × 3 × 2) = √216 ≈ 14.70

SAS: two sides and the included angle

Example: b = 8, c = 5, A = 60°.

a² = 64 + 25 − 2 × 8 × 5 × cos 60° = 89 − 40 = 49
a = 7

Then the law of sines or cosines gives B ≈ 81.79° and C ≈ 38.21°. The area is ½bc sin A = ½ × 8 × 5 × sin 60° ≈ 17.32.

ASA and AAS: two angles and a side

With two angles you always know the third. Then the law of sines scales everything.

Example (ASA): B = 45°, C = 60°, a = 10. A = 180° − 45° − 60° = 75°.

b = a × sin B ÷ sin A = 10 × 0.7071 ÷ 0.9659 ≈ 7.321
c = a × sin C ÷ sin A = 10 × 0.8660 ÷ 0.9659 ≈ 8.966

Example (AAS): A = 40°, B = 65°, a = 12. C = 75°, b ≈ 16.92, c ≈ 18.03.

SSA: the ambiguous case

Two sides and an angle that is not between them may not determine a unique triangle. Picture side b fixed with angle A at one end, and side a swinging from the other end like a pendulum. Depending on its length, it can miss the base line, touch it once or cross it twice.

The deciding length is the height h = b × sin A.

Condition (A acute) Triangles
a < h None
a = h One (a right triangle)
h < a < b Two
a ≥ b One

Example: a = 6, b = 8, A = 30°. h = 8 × sin 30° = 4. Since 4 < 6 < 8, there are two triangles:

sin B = b sin A ÷ a = 8 × 0.5 ÷ 6 = 0.6667
B ≈ 41.81°   or   B ≈ 180° − 41.81° = 138.19°
  • Triangle 1: B ≈ 41.81°, C ≈ 108.19°, c ≈ 11.40
  • Triangle 2: B ≈ 138.19°, C ≈ 11.81°, c ≈ 2.46

Both are valid. A calculator's inverse sine only returns the first, which is how the second one gets missed.

With a = 3 instead, a is shorter than h = 4 and no triangle exists. With a = 4, a equals h and you get exactly one right triangle with B = 90°. With a = 10, longer than b, only one triangle fits.

How to use the Triangle Calculator

  1. Open the Triangle Calculator.
  2. Choose the tab that matches what you know: SSS, SAS, ASA, AAS or SSA. A line under the tabs describes each case.
  3. Fill in the three fields. Labels such as Angle A (between b and c) or Side a (opposite A) tell you exactly which value goes where. Angles are in degrees.
  4. Read the result: the Area at the top, followed by all Sides a, b, c, all Angles A, B, C, the Perimeter, the Type (for example scalene, acute), the three heights and medians, the Inradius r, the Circumradius R and the angles in radians.
  5. In the SSA case, if two triangles are possible, the title says so and buttons let you switch between Triangle 1 and Triangle 2.
  6. A scaled drawing updates with each result, and the steps show which law was applied at each stage.

Impossible inputs, such as sides that break the triangle inequality or angles that add to 180° or more, produce a clear explanation instead of numbers.

Other ways to solve triangles

  • Scientific calculator: a handheld one or our Scientific Calculator is fine for each step, but watch the angle mode (degrees vs radians) and remember that sin⁻¹ never returns the obtuse SSA solution.
  • Spreadsheets: Excel's trigonometric functions work in radians, so wrap angles in RADIANS() and results in DEGREES(), for example =DEGREES(ACOS((B2^2+C2^2-A2^2)/(2*B2*C2))).

For the area of a triangle in a floor plan, the Area Calculator and the guide to calculating the area of common shapes cover the practical side.

Common mistakes

Wrong calculator angle mode

sin 30 in radian mode is about −0.988, not 0.5. Check for "DEG" on the display.

Pairing a side with the wrong angle

The law of sines only works with each side and its opposite angle.

Missing the second SSA triangle

If h < a < b, there are two answers. Always check whether 180° − B also leaves room for the third angle.

Frequently asked questions

When do I use the law of sines instead of the law of cosines?

Use the law of sines when you know a side and its opposite angle (ASA, AAS, SSA). Use the law of cosines when you know three sides or two sides with the angle between them.

Why does SSA sometimes give two triangles?

The known side opposite the angle can reach the third side at two different points, forming one acute and one obtuse triangle. This happens when that side is longer than the height b sin A but shorter than b.

Can I solve a triangle from three angles?

No. Three angles fix the shape but not the size, so infinitely many similar triangles fit. You need at least one side length.

How do I find the area from three sides?

Use Heron's formula: with s = half the perimeter, area = √(s(s − a)(s − b)(s − c)). For sides 5, 6 and 7, that is √216 ≈ 14.70.

What makes a set of three sides impossible?

If one side is as long as or longer than the other two combined, the ends cannot meet. Sides 2, 3 and 6 fail because 2 + 3 is less than 6.

Try it now: Triangle Calculator

Loading tool…