Triangle calculator
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
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.
Area = √(s(s−a)(s−b)(s−c)), where s is half the perimeter. It needs the three sides and nothing else.
When any one is at least as long as the other two combined. The type row says so rather than returning a number.
Because that combination can describe two different triangles. With a = 10, b = 15 and A = 30°, the third side is either 19.60 or 6.38 and nothing in the measurements chooses between them.
SSA: two sides and a non-included angle. It yields two triangles, one, or none depending on how the side opposite the angle compares with the perpendicular height.
Measure 3 along one edge and 4 along the other; the diagonal should be exactly 5. Any multiple of 3-4-5 works, and larger ones are more forgiving of measurement error.
On a flat surface, yes, and the cosine rule guarantees it here. On a sphere they sum to more, which is why long-distance navigation cannot use plane trigonometry.
The height row is the perpendicular onto side a, computed as twice the area divided by a. Divide by b or c instead for the height onto those sides.