Triangle solver (law of sines and cosines)
law of cosines: a² = b² + c² − 2bc·cos A
Give three elements of a triangle and get all three sides, all three angles, the area, the perimeter and both the inradius and circumradius. The SSA configuration (two sides and a non-included angle) is treated as it should be: depending on the values it admits zero, one or two distinct triangles, and the tool returns them all instead of arbitrarily picking one. Impossibilities are named with their geometric reason: triangle inequality, degenerate triangle, angle sum too large, side too short.
a = 8; b = 10; c = 12.423
- Angles
- A = 40°; B = 53.464°; C = 86.536°
- Type
- acute
a = 8; b = 10; c = 2.8978
- Angles
- A = 40°; B = 126.54°; C = 13.464°
- Type
- obtuse
Two different triangles satisfy this data, the ambiguous SSA case: angle B can take its acute value or its supplement. Only one more piece of information (angle B, side c, or the triangle type) settles it.
Scientific dossier
What the tool computes, what it assumes, where it stops being valid, and where its data comes from.
Method & formulaslaw of cosines: a² = b² + c² − 2bc·cos A
law of cosines: a² = b² + c² − 2bc·cos A
law of sines: a/sin A = b/sin B = c/sin C = 2R
area (Heron): S = √(p(p−a)(p−b)(p−c)), p = semi-perimeter
inradius: r = S / p
The law of cosines determines a triangle unambiguously (it generalises Pythagoras); the law of sines is simpler but leaves an ambiguity when starting from a non-included angle, because sin θ = sin(180° − θ). That is where the two SSA solutions come from. Once the three sides are known, the tool recomputes all angles with arccos, never arcsin: arccos spans 0°–180° without confusing an angle with its supplement and stays accurate near 90°. The area uses the stable form of Heron’s formula (Kahan ordering), which does not collapse on very flat triangles.
- Ambiguous case (SSA)
- · two sides and an angle not between them. With h = b·sin A: if a < h, no triangle; if a = h, one right triangle; if h < a < b, two triangles; if a ≥ b, exactly one.
- Triangle inequality
- · each side must be strictly less than the sum of the other two. At equality the points are collinear: a degenerate triangle of zero area, refused as such. Distinctly from the impossible case.
- Radii R and r
- · R (circumradius) is the radius of the circle through the three vertices, r (inradius) that of the circle tangent to the three sides. They appear throughout triangle geometry exercises.
Validity domainPlane Euclidean geometry: no spherical triangles (navigation, geodesy).
Plane Euclidean geometry: no spherical triangles (navigation, geodesy). No hyperbolic ones. AAA configurations (three angles) are not offered, because they determine no size, infinitely many similar triangles satisfy them. Results are floating-point numbers: on extremely flat triangles, the last digits of the area lose meaning even with the stable form used here.
Common pitfall: the law of sines hides a solutionWith a = 8, b = 10 and A = 40°.
With a = 8, b = 10 and A = 40°. The law of sines gives sin B = 0.803, so B = 53.5°, but also B = 126.5°, equally valid: two triangles exist, with very different areas. Most calculators show only one, and the exercise sometimes expects the other. Here both are displayed side by side, together with what would settle the choice. Conversely, with a = 6 and the same b and A, no triangle exists: a is shorter than the height 10·sin 40° = 6.43.