Maths Geometry

Triangle calculator

Mode
Side a
Side b
Hypotenuse 5
√(3² + 4²)
Area 6
Perimeter 12
Angle opposite a 36.8699°
Angle opposite b 53.1301°
Each side must be shorter than the other two

For a right triangle the hypotenuse is √(a² + b²), so 3 and 4 give 5. For any triangle with three known sides, Heron’s formula gives the area from the semi-perimeter and the cosine rule gives every angle: 5, 6 and 7 enclose 14.696938 square units.

How to solve a triangle

1 Choose the tab that matches what you measured: a right angle and two sides, or three sides.
2 Enter the lengths in any single unit; the area comes back in its square.
3 Read the missing side or the area, then the angles beneath it.
4 Check the type row. It names the triangle, and it says so when the three lengths cannot close.

Heron’s formula needs no angle and no height: from the semi-perimeter s, the area is √(s(s−a)(s−b)(s−c)). Two thousand years on it is still the shortest path from three tape measurements to an area, and the cosine rule then recovers each angle from the same three numbers. Three sides fix a triangle completely, which is the reason a triangulated frame is rigid and a rectangular one is not.

Three sides always work; two sides and an angle may not

The tabs here take SSS or a right angle with two legs, and the omission is deliberate. Give a solver two sides and an angle that is not between them and the answer can genuinely be two different triangles. Take a = 10, b = 15 and an angle of 30° opposite a. The sine rule gives sin B = 0.75, and both 48.59° and 131.41° satisfy it, producing third sides of 19.60 and 6.38 respectively. Both are real triangles that match everything you measured.

This is the ambiguous case, SSA, and it is the only one of the standard combinations that misbehaves. SSS, SAS and ASA each determine exactly one triangle. With SSA, write h for the perpendicular height b × sin A: there is no triangle at all when a is shorter than h, exactly one when a equals h or when a is at least as long as b, and two in the band between. Anything that answers an SSA question with a single number has picked a branch on your behalf, and in a survey or a layout the wrong branch is the difference between a plot of 19.6 metres and one of 6.4.

The type row, and what it will not catch

The row names the triangle as equilateral, isosceles or scalene, and it reports "not a triangle" when any side is at least as long as the other two combined. That test runs before the area, so a set of impossible lengths returns nothing rather than a plausible-looking figure from the square root of a negative number.

One numerical caveat sits below the display. The plain form of Heron’s formula loses precision on a needle: sides of 100000, 99999.99999 and 0.00002 give an area good to about six significant figures rather than fifteen, because s and s−a are nearly equal and subtracting them discards most of the digits. At the six decimal places shown here it makes no visible difference, and it is a reason not to feed a very long thin triangle from this page into a chain of further calculations.

What people use it for

  • Finding a diagonal or a hypotenuse
  • Getting the area of an irregular plot from three measured sides
  • Checking that a corner is square
  • Recovering angles from a shape you can only measure with a tape
  • Geometry homework

Questions

Square both other sides, add them, take the square root. 3 and 4 give 5.

Was this tool any good?
Internal signal only · I use it to find the tools worth rebuilding