Triangle Calculator
The triangle calculator solves from whatever sides and angles you know, including the right-triangle case, which is the Pythagorean theorem and most of the traffic.
Hypotenuse
- Hypotenuse a squared plus b squared equals c squared: 9 + 16 = 25.
- 5
- A Pythagorean triple All three sides are whole numbers, which is rare and is why a handful of triples (3-4-5, 5-12-13, 8-15-17) turn up in every textbook and on every building site.
- 3, 4, 5
- Sides
- a = 3, b = 4, c = 5
- Angles Summing to 180 degrees, as every plane triangle must.
- A = 36.87deg, B = 53.13deg, C = 90deg
- Area
- 6
- Perimeter
- 12
- Type
- scalene, right
- Heights The perpendicular from each side to the opposite vertex. Area is half the base times the height for any of the three.
- to a: 4, to b: 3, to c: 2.4
- Circumradius The radius of the circle through all three vertices.
- 2.5
- Inradius The radius of the largest circle that fits inside.
- 1
| a | b | c | Multiples |
|---|---|---|---|
| 3 | 4 | 5 | 6-8-10, 9-12-15, 30-40-50 |
| 5 | 12 | 13 | 10-24-26, 15-36-39 |
| 8 | 15 | 17 | 16-30-34 |
| 7 | 24 | 25 | 14-48-50 |
| 20 | 21 | 29 | 40-42-58 |
| 9 | 40 | 41 | 18-80-82 |
- The Pythagorean theorem holds only for right triangles. For any other triangle the law of cosines generalizes it: c squared equals a squared plus b squared minus 2ab cos(C), which reduces to Pythagoras when C is 90 degrees and cos(C) is zero.
- Any two sides must add to more than the third, or the shape does not close. That triangle inequality is checked here before anything else is computed.
How the Triangle Calculator works
The Pythagorean theorem says that in a right triangle, the square of the hypotenuse equals the sum of the squares of the other two sides: a^2 + b^2 = c^2. With legs of 3 and 4 the hypotenuse is 5, because 9 + 16 = 25.
Two conditions are doing work in that sentence. It applies only to RIGHT triangles (one angle of exactly 90 degrees), and c is specifically the HYPOTENUSE, the side opposite the right angle, which is always the longest. Solving for a leg rather than the hypotenuse means subtracting rather than adding: a = sqrt(c^2 - b^2). Getting that backwards is the most common error with the theorem, and it is detectable, because it produces a leg longer than the hypotenuse, which is impossible.
Most answers are irrational. Legs of 3 and 5 give sqrt(34), which is 5.83095... and never terminates. The exact answer is the radical, and a decimal is a rounding of it. That is why this calculator gives both.
The exceptions are PYTHAGOREAN TRIPLES: whole-number side lengths that satisfy the theorem. 3-4-5 is the smallest, followed by 5-12-13, 8-15-17, 7-24-25 and 20-21-29, plus every multiple of each. The 3-4-5 triple has a practical use that predates the theorem's proof: measure 3 units along one line and 4 along another, and if the diagonal between them is exactly 5, the corner is square. Builders use the 6-8-10 multiple for the same reason every day, and the Egyptians were reportedly laying out right angles this way long before Pythagoras.
For triangles that are not right-angled, the generalization is the LAW OF COSINES: c^2 = a^2 + b^2 - 2ab·cos(C), where C is the angle between a and b. When C is 90 degrees, cos(C) is zero and the last term vanishes, leaving the Pythagorean theorem exactly. That is not a coincidence: Pythagoras is the special case. When an angle and the side opposite it are known, the LAW OF SINES does the work instead: a / sin A = b / sin B = c / sin C. It solves two angles and a side, and two sides with an angle opposite one of them, the one case that can have two answers.
From three sides, everything else follows. HERON'S FORMULA gives the area without needing any angle: with s as half the perimeter, area = sqrt(s(s-a)(s-b)(s-c)). It is remarkable mainly for needing no height, which is the measurement that is usually hardest to get. The angles come from rearranging the law of cosines.
Before any of that, one check has to pass: the TRIANGLE INEQUALITY. Any two sides must add to more than the third. Sides of 2, 3 and 10 cannot form a triangle: lay the 2 and the 3 end to end and they reach 5, which does not span the 10. A calculator that returns an area for impossible sides is producing a number for a shape that does not exist, and Heron's formula will quietly hand back a NaN from a negative square root.
Two classifications worth keeping straight, because they are independent. By sides: equilateral (all three equal), isosceles (two equal), scalene (none). By angles: acute (all under 90), right (one exactly 90), obtuse (one over 90). A triangle has one label from each list, and the angles always sum to exactly 180 degrees in plane geometry. That fact fails on a sphere, where the angles of a triangle sum to more than 180 and the excess is proportional to the area.
Triangle Calculator FAQ
What is the Pythagorean theorem?
In a right triangle, a^2 + b^2 = c^2, where c is the hypotenuse, the side opposite the right angle and always the longest. Legs of 3 and 4 give a hypotenuse of 5. It applies only to right triangles.
How do I find a leg rather than the hypotenuse?
Subtract instead of adding: a = sqrt(c^2 - b^2). With a hypotenuse of 13 and one leg of 5, the other is sqrt(169 - 25) = 12. If your answer comes out longer than the hypotenuse, you added when you should have subtracted.
How do I find the area of a triangle from three sides?
Heron's formula. Take s as half the perimeter, then area = sqrt(s(s-a)(s-b)(s-c)). For sides 3, 4 and 5: s is 6, and the area is sqrt(6 x 3 x 2 x 1) = 6. It needs no height, which is usually the hardest measurement to take.
Can any three lengths form a triangle?
No. Any two sides must add to more than the third, which is the triangle inequality. Sides of 2, 3 and 10 cannot close, because 2 and 3 laid end to end only reach 5 and cannot span the 10. This is checked before anything else here.
Pythagorean theorem and triangle area
- Right triangle calculator
- Law of cosines calculator
- Law of sines calculator
- Equilateral triangle calculator
- Isosceles triangle solver
- Pythagorean theorem calculator
- Triangle area calculator