Skip to content
Quaestio

Triangle solver

Enter three of the six measurements, at least one of them a side, and the rest are worked out.

Side a is opposite angle A, b opposite B and c opposite C. Enter exactly three measurements, at least one of them a side.

Sides

Angles

Embed

Embed this tool on your site

Copy the code and paste it where the tool should appear, such as a blog post or a school page. It is free, the box has no ads and the tool calculates in the visitor’s browser.

How it works

A triangle is determined by three measurements, but only if at least one of them is a side. Three angles give the shape without the size, because all similar triangles share the same angles.

Three known sides are solved with the law of cosines, which gives each angle from the three sides. The tool first checks the triangle inequality: the longest side must be shorter than the other two together.

Two sides with the angle between them are also solved with the law of cosines, which gives the third side directly.

One side and two angles is the simplest case: the third angle follows from the angle sum of 180 degrees, and the law of sines gives the remaining sides.

Two sides and an angle that is not between them is the ambiguous case. The law of sines gives both an acute and an obtuse possibility, and both can be real triangles. They are then shown side by side rather than the tool choosing for you.

Right triangles are not a special case here. Enter your measurements and ninety degrees falls out on its own, as it does when 3, 4 and 5 give a right angle.

How the tool calculates

The law of sines says that a / sin A = b / sin B = c / sin C, and the law of cosines that c² = a² + b² − 2ab cos C. The area is always worked out as ½ × a × b × sin C, one of the forms in NIST’s handbook of mathematical functions, and the perimeter as the sum of the sides. The last angle is found as 180 degrees minus the other two.

Every measurement must be greater than zero. An angle of 180 degrees or more is rejected, as are two angles that add up to 180 or more. Answers are shown to eight significant figures, with angles in degrees.

Example: the ambiguous case

The example button fills in a = 7, b = 10 and A = 40°. The law of sines gives sin B = 10 × sin 40° / 7 ≈ 0.9183. Two angles have that sine: B ≈ 66.674177° and 180° minus that, 113.32582°. Both fit alongside 40°, so there are two triangles.

In the first, C ≈ 73.325823°, c ≈ 10.43216 and the area ≈ 33.528317. In the second, C ≈ 26.674177°, c ≈ 4.8887286 and the area ≈ 15.712071. Both have the same sides a and b and the same angle A.

One, two or no triangle

With two sides and an angle that is not between them, the length of the side opposite the angle decides how many triangles exist. If A is acute and a is shorter than b × sin A there are none: with a = 6 in the example, b × sin A ≈ 6.43, and the tool says the measurements do not form a triangle. If a equals b × sin A exactly there is one, and it has a right angle: a = 5, b = 10 and A = 30° give B = 90°.

If a lies between b × sin A and b, there are two triangles, as in the example above. If a is as long as b or longer, there is only one, because the obtuse option no longer fits. With a = 12, B ≈ 32.388434° and C ≈ 107.61157°. If A is a right or obtuse angle, a must be longer than b, or there is no triangle.

Sources

How the tools are checked