Triangle Solver

Enter any three values, including at least one side. Kalkuli works out the rest, shows which rule it used, and draws the triangle to scale. Side a is opposite angle A, and so on.

Known values

Sides
Angles
Examples:
Drawn to scale

Solution

Area and perimeter
Area = 6 · Perimeter = 12
a = 3, b = 4, c = 5 • A = 36.8699°, B = 53.1301°, C = 90°

Working

Which rule gets used

Every triangle problem comes down to one of five patterns, named by what you know, going round the triangle (S for a side, A for an angle):

You knowExampleRuleAnswers
SSS: three sidesa, b, cLaw of cosines for the anglesOne, if the sides can form a triangle
SAS: two sides and the angle between thema, b, CLaw of cosines for the third sideOne
ASA: two angles and the side betweenA, B, cAngles sum to 180°, then law of sinesOne
AAS: two angles and another sideA, B, aAngles sum to 180°, then law of sinesOne
SSA: two sides and an angle not between thema, b, ALaw of sinesZero, one or two

Three angles on their own (AAA) don't pin a triangle down, because you can scale it up or down without changing the angles. That's why at least one side is required.

The law of cosines

c² = a² + b² − 2ab·cos C cos C = (a² + b² − c²) / 2ab

It's Pythagoras with a correction term. When C = 90°, cos C = 0 and you get c² = a² + b². It's the safe choice for angles because cos⁻¹ returns a single answer between 0° and 180°, so there's never any doubt about which angle you mean.

The law of sines

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

R is the radius of the circle through all three corners. The catch is that sin⁻¹ only returns angles up to 90°, but sin 40° = sin 140°, so an angle found this way could be either one. That's the ambiguous case.

Worked example: the ambiguous case

a = 8, b = 10, A = 40°. The law of sines gives sin B = 10 × sin 40° / 8 = 0.8035, so B = 53.46° or B = 180° − 53.46° = 126.54°.

Both leave room for a third angle (86.54° or 13.46°), so both triangles exist: one with c = 12.42 and one with c = 2.90. Picture swinging side a, pivoting from the top corner, until it reaches the base line. It can land in two places. The "Ambiguous SSA" example above shows both, and you can switch between them.

If a were 12 (longer than b) there would be only one triangle, and if a were 5 (shorter than b sin A = 6.43) it couldn't reach the base at all.

Area, inradius and circumradius

Once all three sides are known, Heron's formula gives the area without needing a height: with s = (a + b + c)/2, Area = √(s(s − a)(s − b)(s − c)). The radius of the largest circle that fits inside is r = Area / s, and the radius of the circle through the corners is R = abc / (4 × Area).