Skip to content
CALX
Appearance

Appearance

Light or dark

Colour
Accessibility

Triangle solver (law of sines and cosines)

A triangle solved from SSS, SAS, ASA or SSA, with the ambiguous case handled: zero, one or two triangles, all displayed.

Parameters

Result

Solution 1

a = 8; b = 10; c = 12.423

Angles
A = 40°; B = 53.464°; C = 86.536°
Type
acute
a = 8b = 10c = 12.4A 40°B 53.5°C 86.5°
Area
39.927
Perimeter
30.423
Circumradius R
6.2229
Inradius r
2.6248
Solution 2

a = 8; b = 10; c = 2.8978

Angles
A = 40°; B = 126.54°; C = 13.464°
Type
obtuse
a = 8b = 10c = 2.9A 40°B 127°C 13.5°
Area
9.3135
Perimeter
20.898
Circumradius R
6.2229
Inradius r
0.89133
Note

Two triangles satisfy this data (ambiguous SSA case): angle B is acute or its supplement. Angle B, side c or the triangle type settles it.

Calculation, assumptions and sources

OverviewThree elements of a triangle give all three sides, all three angles, the area, the perimeter and both the inradius and circumradius.

Three elements of a triangle give all three sides, all three angles, the area, the perimeter and both the inradius and circumradius. In SSA (two sides and a non-included angle), zero, one or two triangles exist depending on the values; all are shown. An impossibility is named with its reason: triangle inequality, degenerate triangle, angle sum too large, side too short.

Method & formulaslaw of cosines: a² = b² + c² − 2bc·cos A
law of cosines: a² = b² + c² − 2bc·cos Alaw of sines: a/sin A = b/sin B = c/sin C = 2Rarea (Heron): S = √(p(p−a)(p−b)(p−c)), p = semi-perimeterinradius: r = S / p

The law of cosines, which generalises Pythagoras, determines a triangle unambiguously. The law of sines leaves an ambiguity when starting from a non-included angle, because sin θ = sin(180° − θ). Angles are recomputed with arccos, and the area with the stable form of Heron’s formula (Kahan).

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 is strictly less than the sum of the other two. At equality the points are collinear: a degenerate triangle of zero area, flagged separately.
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.
Validity domainPlane Euclidean geometry; spherical (navigation, geodesy) and hyperbolic triangles are not handled.

Plane Euclidean geometry; spherical (navigation, geodesy) and hyperbolic triangles are not handled. The AAA configuration (three angles) is not offered: it does not fix the size. On extremely flat triangles, the last digits of the area lose meaning.

The ambiguous SSA caseWith a = 8, b = 10 and A = 40°, the law of sines gives sin B = 0.803, so B = 53.5° or B = 126.5°: two triangles, with very different areas.

With a = 8, b = 10 and A = 40°, the law of sines gives sin B = 0.803, so B = 53.5° or B = 126.5°: two triangles, with very different areas. Arcsin returns only the acute angle. With a = 6 and the same b and A, no triangle exists: a is shorter than the height 10·sin 40° = 6.43.