Understanding the right triangle and Pythagorean theorem calculator — concept and principle
Enter the two legs of a right triangle (the sides that form the 90° angle) and this calculator returns the hypotenuse, both acute angles, the area and the height from the right angle to the hypotenuse. It is the everyday tool for ladder and ramp lengths, roof pitch, screen diagonals, distances on a map grid and checking that a frame is square.
How it is calculated
- Hypotenuse (Pythagorean theorem): c = √(a² + b²).
- Angles: A = arctan(a ÷ b), the angle opposite leg a; B = arctan(b ÷ a) = 90° − A.
- Area: a × b ÷ 2.
- Height to the hypotenuse: h = a × b ÷ c.
Both legs must use the same unit; c and h are in that unit, the area in that unit squared, and the angles in degrees.
The principle
Place four copies of the right triangle inside a square of side a + b so that their hypotenuses form a tilted inner square of side c. The big square's area is (a + b)², which equals the four triangles (4 × ab/2 = 2ab) plus the inner square (c²). So a² + 2ab + b² = 2ab + c², hence a² + b² = c². The angles follow from the tangent, opposite ÷ adjacent. The height formula comes from computing the area two ways: ½ab with the legs as base and height, and ½ch with the hypotenuse as base.
Worked example
- Default inputs: a = 3, b = 4.
- Hypotenuse: c = √(9 + 16) = √25 = 5.
- Angle A = arctan(3 ÷ 4) = 36.86989765°; angle B = arctan(4 ÷ 3) = 53.13010235°. They add to 90°.
- Area: 3 × 4 ÷ 2 = 6.
- Height to the hypotenuse: 12 ÷ 5 = 2.4.
| Leg b | Hypotenuse c |
|---|---|
| 1 | 3.16227766 |
| 2 | 3.605551275 |
| 3 | 4.242640687 |
| 4 | 5 |
| 5 | 5.830951895 |
| 6 | 6.708203932 |
| 8 | 8.544003745 |
How to read the result
The hypotenuse is always the longest side but shorter than a + b. Equal legs give 45° angles and c = a√2 ≈ 1.414a. For a ramp, the angle opposite the rise is the slope angle; a 1 : 12 ramp (rise 1, run 12) is about 4.76°. The height to the hypotenuse is the shortest distance from the right-angle corner to the long side.
Common mistakes
- Entering the hypotenuse as a leg; this calculator expects the two shorter sides.
- Using a² + b² = c² for a triangle without a right angle; use the law of cosines instead.
- Forgetting the square root and reporting c² = 25 as the length.
- Mixing degrees and percent slope: a 100% slope is 45°, not 90°.
Frequently asked questions
How do I find a leg if I know the hypotenuse?
Rearrange: b = √(c² − a²). With c = 13 and a = 5, b = √144 = 12.
How do I calculate a TV screen's diagonal?
The width and height are the legs; a 16:9 screen 120 cm wide is about 67.5 cm tall, so the diagonal is about 137.7 cm.
Does the theorem work in three dimensions?
Yes. A box's space diagonal is √(a² + b² + c²).
Sources: Heath, T. L. (trans.), The Thirteen Books of Euclid's Elements, Book I, Proposition 47 · Maor, E., The Pythagorean Theorem: A 4,000-Year History, Princeton University Press