Triangle Solver
Results
Formulas Used in Triangle Solver
Full formula reference: Triangle Perimeter Formula · Triangle Formulas · Equilateral Triangle Formula
In-Depth Tutorial: Triangle Solver
"Solving a triangle" means: given three of the six parts of a triangle (three sides + three angles), find the other three. Whether your three knowns are SSS / SAS / ASA / AAS / SSA, the Triangle Solver picks the right formula automatically. This tutorial walks through what happens behind each click, so you know which inputs produce a unique triangle and which produce zero or two solutions.
The six parts of a triangle
Every triangle has three sides (labelled a, b, c) and three angles (A, B, C) — each angle opposite the side of the same letter. Solving a triangle requires at least three known parts, with at least one being a side (because three angles without any side define infinitely many similar triangles).
The two master formulas
Every method reduces to one of two relationships:
- Law of Cosines: c² = a² + b² − 2ab·cos(C). Solves for a side when you have two sides and the included angle, or solves for an angle when you have all three sides.
- Law of Sines: a/sin(A) = b/sin(B) = c/sin(C). Solves for a side when you have a side, its opposite angle, and one more angle.
SSS — three sides given
Inputs: a, b, c. Outputs: A, B, C, area, perimeter.
The solver computes cos(C) = (a² + b² − c²) / (2ab), takes arccos to get C, repeats for A or B, then uses A + B + C = 180° for the last. Heron's Formula gives area from just the three sides — no height needed.
Example: a = 5, b = 7, c = 9. cos(C) = (25 + 49 − 81) / 70 = −0.1 → C ≈ 95.74°. sin(A) / 5 = sin(95.74°) / 9 → A ≈ 33.56°. B = 180° − 95.74° − 33.56° = 50.70°. Area = √(s(s−a)(s−b)(s−c)) where s = 10.5 → Area ≈ 17.41.
SSS always gives a unique triangle provided the triangle inequality holds (each side < sum of the other two).
SAS — two sides + included angle
Inputs: two sides and the angle between them (e.g. a, b, C).
Law of Cosines gives the third side: c² = a² + b² − 2ab·cos(C). Then Law of Sines gives one of the other angles, and the third is 180° minus the sum.
Example: a = 8, b = 10, C = 60°. c² = 64 + 100 − 160·cos(60°) = 84 → c ≈ 9.17. sin(A) / 8 = sin(60°) / 9.17 → A ≈ 49.11°. B = 70.89°.
ASA — two angles + included side
Inputs: two angles + the side between them (e.g. A, B, c).
Third angle = 180° − A − B. Then Law of Sines for each remaining side.
Example: A = 50°, B = 60°, c = 12. C = 70°. a = 12 × sin(50°) / sin(70°) ≈ 9.78. b ≈ 11.06.
AAS — two angles + a non-included side
Inputs: two angles and a side opposite one of them (e.g. A, B, a). Same as ASA: compute third angle, then Law of Sines.
SSA — the ambiguous case
Inputs: two sides + an angle opposite one of them (e.g. a, b, A — but the angle isn't between the two sides).
This is the only case that can produce zero, one, or two valid triangles. The solver checks sin(B) = b × sin(A) / a:
- If sin(B) > 1 → no triangle exists (side b too long for angle A).
- If sin(B) = 1 → one right triangle (B = 90°).
- If sin(B) < 1 → two candidates B₁ = arcsin(...) and B₂ = 180° − B₁. Both are valid if A + B<180° in each case.
Example with two solutions: a = 6, b = 8, A = 35°. sin(B) ≈ 0.7648. B₁ ≈ 49.86° (acute), B₂ ≈ 130.14° (obtuse). A + B₁ = 84.86° and A + B₂ = 165.14° — both < 180°, so both are valid triangles. The solver returns the acute one as primary and attaches an "ambiguous_note" result showing the obtuse alternative.
Common mistakes
- Using Law of Sines when Law of Cosines is needed. Law of Sines requires a known side-angle pair. For SSS or SAS you must start with Law of Cosines.
- Forgetting the SSA second solution. Real-world problems with measured angles can land in the ambiguous zone; always check whether B₂ = 180° − B₁ also satisfies A + B₂ < 180°.
- Radians vs degrees. All examples assume degree mode. If your manual answer is off by a factor of ~60, you forgot to convert.
- Mixing side-angle labels. Side a is opposite angle A, side b opposite B, side c opposite C. Hand-drawn diagrams sometimes use the wrong pairing.
When to use a different calculator
- For right triangles only, the Right Isosceles Calculator or Special Right Triangles tool is faster.
- For just the area from three sides, Heron's Formula Calculator skips the angle-finding step.
- For coordinate-defined triangles (vertices at (x,y) points), use the Triangle in Coordinate Geometry page.
- For congruence proofs (verifying two triangles match via SSS/SAS/ASA/AAS/HL), see the Congruent Triangle Calculator.
Related concepts
The solver also returns circumradius R = abc / (4·area) — the radius of the circle passing through all three vertices — and inradius r = area / s where s = semi-perimeter. The three altitudes h_a = 2·area / a (similar for h_b, h_c) are also computed. These extras let you verify the triangle quickly: the formula R = abc / (4·area) is independent of the solving method, so a self-consistency check is "did I get the same R both ways?".
Frequently Asked Questions – Triangle Solver
Enter exactly 3 of the 6 values, and at least one must be a side. Common combinations: SSS (3 sides), SAS (2 sides + included angle), ASA (2 angles + included side), AAS (2 angles + any side).
The inputs may be impossible — angles not summing to 180°, or sides violating the triangle inequality (each side must be less than the sum of the other two).
It applies the Law of Cosines for SSS and SAS, the Law of Sines for ASA and AAS, and Heron's Formula to compute area from the three sides.
Subtract the two known angles from 180°. For angles of 50° and 60°, the third is 180° − 50° − 60° = 70°. Enter just the two angles; add one side to get every side length too.
Area = ½ × base × height, with the height measured at a right angle to the base. A base of 8 and a height of 5 give an area of 20. Choose "Base and height" above.
With two sides and an angle that is not between them (SSA) there can be two solutions — the ambiguous case. The solver then shows both triangles.
Yes — standard calculations are completely free and unlimited. AI Solve generates detailed step-by-step explanations using 3 credits (30 free on sign-up).
Where triangle solving comes from — and where it still matters
Solving triangles is one of the oldest computational problems in mathematics. Hipparchus of Nicaea (~150 BCE) is generally credited as the first to compile chord tables — the ancient predecessor of the sine table — specifically so astronomers could solve triangles formed by Earth, the Sun, and stars. Three centuries later Ptolemy's Almagest extended those tables and made systematic triangle solving the workhorse of Greek astronomy. The Law of Cosines in its modern form was first written down by the Persian mathematician al-Kāshī in the 15th century; the Law of Sines appears in 13th-century work by Nasir al-Din al-Tusi. The formulas this calculator runs are roughly 700 years old.
They are still load-bearing today in surprising places. Land surveying still uses chained triangulation networks to extend a known baseline into a continental-scale coordinate grid — the entire US Public Land Survey is built on this principle. Structural engineers analyze roof and bridge trusses by repeatedly solving the triangles each gusset plate joins. Astronomers measure distances to nearby stars by stellar parallax: a very thin triangle whose tiny apex angle is the parallax (often less than 0.001″ of arc) and whose base is the Earth's orbital diameter (~300 million km). And GPS, while it works on a sphere rather than a plane, uses the spherical analog of the same formulas.
When the arithmetic gets touchy
The formulas are exact, but the inputs you give a calculator never are. Three input patterns hit numerical edges hard enough to be worth knowing about:
Near-degenerate triangles — when one side is almost as long as the sum of the other two (say a = 5, b = 7, c = 11.999), the term (a² + b² − c²) / (2ab) inside arccos approaches −1, and floating-point rounding can push it just past −1, returning NaN or the wrong branch. The solver checks the triangle inequality (each side strictly less than the sum of the other two) with a small tolerance before computing; sliver triangles that pass the check still lose accuracy in their angles because arccos is steep near ±1.
Very thin triangles — when one angle is below about 1°, sin of that angle is tiny, so the Law of Sines divides by something close to zero. Two-digit input precision can produce a four-digit-error output. If you genuinely need accurate angles for a triangle one of whose angles is fractions of a degree, work with the side ratios directly instead of going through arcsine.
The SSA boundary — when b·sin(A)/a equals 1 exactly, there is one right-triangle solution; when it's just below 1 (say 0.99999), there are two valid triangles that differ by tens of degrees. Whether your real-world data lands above or below 1 depends on the last decimal place of your measurement, which is essentially random. Always verify SSA results by feeding the returned angles back into the Law of Sines and checking the third side matches.
Questions the basic FAQ doesn't cover
How is the Law of Cosines related to the Pythagorean theorem?
It's the Pythagorean theorem with an extra correction term for non-right triangles. Set C = 90° in c² = a² + b² − 2ab·cos(C): because cos(90°) = 0, the formula collapses to c² = a² + b². The −2ab·cos(C) term measures exactly how much the relationship deviates from the right-angle case. For an acute C, the term is negative so c² < a² + b²; for obtuse C, positive so c² > a² + b².
What's the connection to vectors and the dot product?
If sides a and b are vectors emanating from the same vertex, then side c is the vector a − b. Computing |a − b|² via the dot product gives |a|² + |b|² − 2(a·b), and since a·b = |a||b|cos(C), this is exactly the Law of Cosines. So the law isn't a separate theorem from vector geometry — it's the same statement in different notation. Anyone comfortable with the dot product already knows the Law of Cosines.
Can this solver handle a triangle on the surface of a sphere?
No. This tool assumes a flat (Euclidean) plane. Spherical triangles — used in navigation, astronomy, and large-scale geodesy — obey different relationships: the spherical Law of Cosines is cos(a) = cos(b)·cos(c) + sin(b)·sin(c)·cos(A) where a, b, c are arc lengths in radians, not linear distances. The angles of a spherical triangle also sum to more than 180° (the excess is proportional to the triangle's area). For a triangle whose sides are short compared to the sphere's radius — say, a city-block-sized survey — the planar formulas are accurate to within rounding error.
Why do my hand-computed angles sum to 179.99° instead of exactly 180°?
Floating-point rounding in arccos. Each angle the solver returns is accurate to roughly 13 decimal digits in radians but typically displayed to 4 decimal places in degrees, so each truncation throws away a tiny amount. Three truncations don't always sum back to a clean 180. As a rule of thumb: a sum within 0.01° of 180° is rounding noise; a sum off by more than 0.1° usually means inconsistent input data — for example, an SSS triangle whose sides don't quite satisfy the triangle inequality, or an ASA case where the third angle was computed first.