Skip to main content
Online
Geometry · step-by-step

Triangle Solver

Enter any three values (at least one side) and the solver finds the rest using the law of cosines and the law of sines, handles the ambiguous SSA case, and draws the triangle to scale.

Enter any three values including at least one side. Angles in degrees. Side a is opposite angle A, and so on.

Complete guide

How to solve any triangle: law of sines, law of cosines and the ambiguous case

3 min read Reviewed By the GetCalcMaster team · Editorial policy

A triangle has six measurements: three sides (a, b, c) and three angles (A, B, C), where each side is opposite the angle with the same letter. Knowing any three of them — as long as at least one is a side — usually determines the rest. The two tools you need are the law of cosines and the law of sines, plus the fact that the angles add up to 180°.

The solver identifies which case you have (SSS, SAS, ASA/AAS or SSA), picks the right law for each step, warns you about the ambiguous SSA case where two different triangles fit, and draws the result to scale.

Key formulas

Angle sum
A + B + C = 180°
Gives the third angle immediately when two are known.
Law of cosines
c² = a² + b² − 2ab cos C
Use for SSS (find angles) and SAS (find the third side). Reduces to Pythagoras when C = 90°.
Law of sines
a / sin A = b / sin B = c / sin C = 2R
Use for ASA, AAS and SSA. R is the circumradius.
Area
Area = ½ ab sin C · Heron: √(s(s−a)(s−b)(s−c)), s = (a+b+c)/2
Heron's formula needs only the three sides.
Right triangles (SOH-CAH-TOA)
sin = opp/hyp, cos = adj/hyp, tan = opp/adj
Plus a² + b² = c² for the hypotenuse c.

Worked examples

Example 1: SAS: two sides and the included angle

a = 8, c = 11, B = 37°.

  1. b² = 8² + 11² − 2·8·11·cos 37° ≈ 64 + 121 − 140.56 = 44.44, so b ≈ 6.666.
  2. Find A with the law of cosines: A ≈ 46.24°.
  3. C = 180° − 37° − 46.24° ≈ 96.76°.
Answer: b ≈ 6.666, A ≈ 46.24°, C ≈ 96.76°.
Example 2: SSS: three sides

a = 7, b = 9, c = 12.

  1. cos C = (49 + 81 − 144)/(2·7·9) = −14/126 ≈ −0.1111 → C ≈ 96.38° (obtuse).
  2. Similarly A ≈ 35.43° and B ≈ 48.19°.
Answer: A ≈ 35.43°, B ≈ 48.19°, C ≈ 96.38°.
Example 3: SSA: the ambiguous case

a = 6, b = 8, A = 40°.

  1. sin B = 8 sin 40° / 6 ≈ 0.857, so B ≈ 58.99° or B ≈ 121.01°.
  2. Both leave a positive C: 81.01° or 18.99°.
Answer: Two triangles: c ≈ 9.220 or c ≈ 3.037.
Example 4: A 3-4-5 right triangle

a = 3, b = 4, c = 5.

  1. 3² + 4² = 25 = 5², so C = 90°.
  2. A = arctan(3/4) ≈ 36.87°, B ≈ 53.13°.
  3. Area = ½ · 3 · 4 = 6.
Answer: Right triangle, area 6.

Which law for which case?

Known values Case First step
Three sides SSS Law of cosines for an angle
Two sides + included angle SAS Law of cosines for the third side
Two angles + any side ASA / AAS Third angle, then law of sines
Two sides + non-included angle SSA Law of sines — check for 0, 1 or 2 triangles
Three angles AAA Shape only; size undetermined

Understanding the ambiguous case

With two sides and an angle that is not between them, the side opposite the known angle can “swing” and touch the base in two places, one place, or not at all. Algebraically, sin B = k has two solutions between 0° and 180° (B and 180° − B). The solver keeps each solution that leaves a positive third angle, which is why it can report two triangles.

Common mistakes to avoid

  • Using degree values while the calculator is in radian mode.
  • Using the law of sines to find an obtuse angle (arcsin only returns angles up to 90°).
  • Labelling sides inconsistently — side a must be opposite angle A.
  • Forgetting the second solution in the SSA case.

Frequently asked questions

Can I solve a triangle from three angles?
No. Three angles fix the shape but not the size: infinitely many similar triangles share the same angles. At least one side is required.
Why does the solver sometimes return two triangles?
That is the ambiguous SSA case. Both triangles are geometrically valid; the context of your problem decides which one you need.
What units should I use?
Any length unit, as long as all sides use the same one. Angles are in degrees.

Related tools and guides

Educational content. Results are computed in your browser with standard double-precision arithmetic; double-check anything with legal, financial, medical, or safety consequences. Spotted an error? Tell us and we will correct it.