The formula
a² + b² = c²
c = √(a² + b²)
a = √(c² − b²)
b = √(c² − a²)
Area = ½ab, α = arctan(a ÷ b), β = 90° − α
Worked example
- Legs a = 3 and b = 4.
- c² = 3² + 4² = 9 + 16 = 25.
- c = √25 = 5.
- Area = ½ × 3 × 4 = 6, and the perimeter = 3 + 4 + 5 = 12.
- Angle opposite a: α = arctan(3 ÷ 4) ≈ 36.87°, so β ≈ 53.13°.
The Pythagorean theorem
In any right triangle (a triangle with one 90° angle), the square of the longest side, the hypotenuse c, equals the sum of the squares of the other two sides, the legs a and b: a² + b² = c². The theorem is named after the Greek mathematician Pythagoras (c. 570–495 BC), although Babylonian, Indian and Chinese mathematicians knew the relationship centuries earlier. It's one of the most used results in all of mathematics, with hundreds of known proofs.
The hypotenuse is always opposite the right angle and is always the longest side. If you're solving for a leg, the hypotenuse you enter must be longer than the other leg, or no real triangle exists. The calculator checks this for you.
Pythagorean triples
Some right triangles have whole-number sides. These sets are called Pythagorean triples. The best known is 3-4-5, and any multiple of a triple is also a triple (6-8-10, 9-12-15). Others include 5-12-13, 8-15-17, 7-24-25 and 20-21-29. Builders have used the 3-4-5 rule for thousands of years to check that corners are square. Measure 3 units along one wall and 4 along the other. If the diagonal is exactly 5, the corner is 90°.
Real-world uses
- Construction and DIY: squaring foundations and decks, working out rafter lengths and roof pitches, and finding the diagonal of a room or a sheet of material.
- Ladders: how long a ladder you need to reach a given height when its foot is a set distance from the wall. Safety guidance suggests about 1 unit out for every 4 units up (roughly 75°).
- Screens: TV and monitor sizes are diagonals. A 16:9 screen with a 55-inch diagonal is about 47.9 in wide and 27 in tall.
- Navigation and maps: the straight-line distance between two points on a grid is √(Δx² + Δy²). In 3D, it's √(Δx² + Δy² + Δz²).
- Physics and engineering: combining perpendicular forces, velocities or electrical quantities (for example, impedance from resistance and reactance).
Beyond right triangles
The theorem only applies to right triangles. For other triangles, use the law of cosines: c² = a² + b² − 2ab·cos(C), which reduces to Pythagoras when C = 90° because cos 90° = 0. The converse is also useful: if a² + b² = c² for a triangle's sides, the triangle must contain a right angle. If a² + b² > c², the angle opposite c is acute, and if a² + b² < c², it's obtuse.
Step by step: how long a ladder do you need?
Suppose you need to reach a gutter 4 m (about 13 ft) above the ground, and safety guidance says the foot of the ladder should be about one quarter of the height away from the wall, so 1 m. The ladder forms the hypotenuse of a right triangle with legs of 4 m and 1 m.
- Square the legs: 4² = 16 and 1² = 1.
- Add them: 16 + 1 = 17.
- Take the square root: √17 ≈ 4.12 m.
You need a ladder at least 4.12 m long, plus extra if you need to step off at the top (often about 1 m beyond the landing point). Working the other way, if you have a 5 m ladder and place its foot 1.2 m from the wall, it reaches √(5² − 1.2²) = √(25 − 1.44) ≈ 4.85 m up the wall. Select "Leg a" above to solve this kind of problem.