Mathematics · 5 min read
Pythagorean Theorem: Formula, Triples and Uses
By TheCalcUniverse Editorial, Education Team · · Updated
The Pythagorean theorem says that in a right triangle the square of the longest side (the hypotenuse, c) equals the sum of the squares of the two shorter sides (the legs, a and b): a squared + b squared = c squared. It holds only when one angle is exactly 90 degrees, and it lets you find any one side when you know the other two.
How do you solve for each side?
- Hypotenuse: c = square root of (a squared + b squared)
- A missing leg: a = square root of (c squared - b squared), or b = square root of (c squared - a squared)
- Check: the hypotenuse is always the longest side, so c must be larger than either leg
Example: legs of 5 and 12 give c = square root of (25 + 144) = square root of 169 = 13. The area is half the product of the legs, 0.5 x 5 x 12 = 30, and the perimeter is 5 + 12 + 13 = 30. The two acute angles come from the tangent: atan(5 / 12) = 22.62 degrees opposite the 5 side and 90 - 22.62 = 67.38 degrees opposite the 12 side. These are the same quantities the Right Triangle Calculator reports.
How can you square a corner with it?
If you mark out a rectangle 12 feet by 16 feet, both diagonals must measure exactly square root of (144 + 256) = 20 feet for the corners to be true right angles. A diagonal that is off tells you how far out of square the corner is, using the law of cosines (the general form of the theorem for any triangle).
| Measured diagonal (ft) | Corner angle | Out of square by |
|---|---|---|
| 19.5 | 87.05 degrees | 2.95 degrees (too tight) |
| 20.0 | 90.00 degrees | 0.00 degrees |
| 20.5 | 93.02 degrees | 3.02 degrees (too open) |
Half a foot of diagonal error across a 12 by 16 layout is therefore about 3 degrees, which is plenty to see in a deck or frame. Measurement error matters as much as arithmetic: measure to the same point on the tape each time. For structural work, follow your local building code and the plans rather than a blog post.
Where else does the theorem turn up?
| Situation | Known | Result |
|---|---|---|
| Ladder (illustrative) | 6 m ladder, top 5 m up the wall | Foot is 3.32 m from the wall, ladder angle 56.4 degrees |
| Screen size | 27 inch diagonal, 16:9 | About 23.53 in wide by 13.24 in tall |
| Distance on a grid | Points (3, 4) and (11, 10) | Horizontal 8, vertical 6, distance 10 |
| Box diagonal | 3 x 4 x 12 | Square root of (9 + 16 + 144) = 13 |
| Room diagonal | 12 x 10 x 8 ft | Square root of 308 = 17.55 ft |
The screen row works backwards: for a 16:9 shape the diagonal is square root of (16 squared + 9 squared) = 18.358 units per 16 units of width, so width = 27 x 16 / 18.358 = 23.53 inches. Three-dimensional diagonals use the theorem twice, which is why the box diagonal is the square root of the sum of three squares. For a ladder, the right base distance depends on the manufacturer's instructions and safety guidance, so use this figure for geometry only.
What are Pythagorean triples?
A Pythagorean triple is a set of three whole numbers that satisfy the equation exactly, such as 3-4-5 and 5-12-13. Multiplying every number in a triple by the same factor gives another (3-4-5 becomes 6-8-10). For any whole numbers m greater than n, the three numbers m squared - n squared, 2mn and m squared + n squared always form a triple, because (m squared - n squared) squared + (2mn) squared simplifies to (m squared + n squared) squared. This is Euclid's formula.
| m, n | a = m squared - n squared | b = 2mn | c = m squared + n squared | Check a squared + b squared = c squared |
|---|---|---|---|---|
| 2, 1 | 3 | 4 | 5 | 9 + 16 = 25 |
| 3, 2 | 5 | 12 | 13 | 25 + 144 = 169 |
| 4, 1 | 15 | 8 | 17 | 225 + 64 = 289 |
| 4, 3 | 7 | 24 | 25 | 49 + 576 = 625 |
| 5, 2 | 21 | 20 | 29 | 441 + 400 = 841 |
Does it work in reverse?
Yes. If three sides satisfy a squared + b squared = c squared, the triangle is a right triangle. If c squared is smaller than a squared + b squared, the largest angle is acute; if it is larger, that angle is obtuse. Sides 6, 8, 10 give 36 + 64 = 100, a right triangle. Sides 7, 9, 11 give 49 + 81 = 130, which is more than 121, so all angles are acute. Sides 6, 8, 11 give 100, which is less than 121, so one angle is obtuse.
Common mistakes
- Using the theorem on a triangle that is not a right triangle. For other triangles use the law of cosines: c squared = a squared + b squared - 2ab cos(C). When C is 90 degrees, cos(C) is 0 and the extra term vanishes.
- Adding the lengths instead of the squares, or forgetting the final square root.
- Treating a leg as the hypotenuse. Solving for a leg needs a subtraction, and the result is only real if the hypotenuse is the larger value; the calculator returns nothing when c is not larger than the known leg.
- Mixing units. Feet and inches must be converted to one unit before squaring.
- Over-rounding early. Carry several decimals through the square root and round at the end.
Solve any right triangle instantly
Use our Right Triangle Calculator to find the hypotenuse, legs, area, perimeter, and angles — all with step-by-step SOH CAH TOA trigonometry, plus a dynamic SVG diagram.
Try the Right Triangle Calculator