How the Pythagorean theorem works
For a right triangle with legs a and b meeting at the right angle, and hypotenuse c opposite it:
a² + b² = c²
To find the hypotenuse, add the leg squares and take the square root. To find a missing leg, subtract the known leg's square from the hypotenuse's square and take the root: a = √(c² − b²). The same equation also works as a right-angle test: if a² + b² equals c² exactly, the angle opposite c is 90°. The classic 3-4-5 triangle (9 + 16 = 25) is the smallest whole-number case.
Worked example
You need a diagonal brace across a wall. The wall is 3 ft tall and the brace must reach 5 ft horizontally: b = √(25 − 9) = √16 = 4 ft. Conversely, legs of 6 ft and 8 ft give a diagonal of √(36 + 64) = √100 = 10 ft — the other half of the 3-4-5 family, and the ratio behind the 0.6 × 0.8 × 1.0 right triangle used in roof and stair calculations.
Beyond flat right triangles
To find the space diagonal of a box, use the theorem in two steps: treat the box's footprint diagonal as one leg and the height as the other, then apply the theorem again. It is also the fastest way to check whether two lengths can form a triangle at all (a + b > c), and the basis of surveying offsets, roof rafter lengths and camera field-of-view diagonals.