Pythagorean Theorem Calculator
The Pythagorean Theorem — a² + b² = c² — is part of the US Common Core State Standards for Mathematics (8.G.B.6, 8.G.B.7) and one of the most-used formulas in K-12 geometry classes, AP Physics, and the SAT/ACT math sections. In a right triangle, the square of the hypotenuse equals the sum of the squares of the two legs. The same theorem underpins everyday US tasks: framing a wall square with the 3-4-5 method carpenters use on US construction sites, sizing a flat-screen TV diagonal (measured in inches), checking the diagonal of a roof rafter, or computing straight-line distance between GPS points. This calculator solves for the hypotenuse or either leg and also returns the area, perimeter, and interior angles in degrees.
When to use this calculator
- Check if a wall or piece is square (if 3-4-5 gives exactly 5, it's at a right angle).
- Calculate a TV or monitor diagonal to see if it fits in furniture.
- Find the length of a ladder leaning against a wall given height and base distance.
- Calculate the straight-line distance between two coordinate points.
- Solve geometry homework for right triangle problems.
Example: Diagonal of a 4 x 3 meter room
- Context: you want to know if a 5 m ladder fits diagonally through a 4x3 m room.
- Leg a: 4 m (length).
- Leg b: 3 m (width).
- Formula:
c = sqrt(a² + b²). - Calculation:
c = sqrt(4² + 3²) = sqrt(16 + 9) = sqrt(25) = 5. - Verification:
5² = 25 = 16 + 9 = 4² + 3²confirmed. - Triangle area:
(4 x 3) / 2 = 6 m². - Angles: alpha = arctan(4/3) = 53.13 degrees, beta = arctan(3/4) = 36.87 degrees.
How it works
2 min readThe Theorem
a² + b² = c²Where:
Finding the Hypotenuse
c = sqrt(a² + b²)Finding a Leg
a = sqrt(c² - b²)
b = sqrt(c² - a²)Famous Pythagorean Triples
Sets of three whole numbers that perfectly satisfy the theorem:
| a | b | c |
|---|---|---|
| 3 | 4 | 5 |
| 5 | 12 | 13 |
| 6 | 8 | 10 (multiple of 3-4-5) |
| 7 | 24 | 25 |
| 8 | 15 | 17 |
| 9 | 40 | 41 |
| 20 | 21 | 29 |
The 3-4-5 triple is the most useful in construction. If a triangle has sides of exactly 3, 4, and 5 units, it's a right triangle -- this lets you verify right angles with just a tape measure.
Generating Triples (Euclid's Formula)
a = m² - n²
b = 2mn
c = m² + n²With m > n > 0 as integers. Example: m=2, n=1 gives (3, 4, 5).
Calculating Angles
Once you have all three sides, the acute angles are:
alpha = arctan(a / b)
beta = arctan(b / a)
alpha + beta = 90° (all three angles sum to 180°, one is 90°)Real-World Applications
Construction
Checking right angles: measure 3 ft and 4 ft along two walls -- the diagonal must be exactly 5 ft. If it's 4.95 or 5.05, the walls aren't square. Used by carpenters and builders for 2,500 years.
Ladder length: ladder against a wall, height 4 m, base 1 m from wall. Length = sqrt(1² + 4²) = sqrt(17) = 4.12 m.
Screen Sizes
A 55-inch TV means 55" diagonal. For a 16:9 aspect ratio:
Distance Between Points
Straight-line distance between two points (x1, y1) and (x2, y2):
d = sqrt((x2 - x1)² + (y2 - y1)²)This is the Pythagorean theorem applied to Cartesian coordinates. In 3D:
d = sqrt((x2-x1)² + (y2-y1)² + (z2-z1)²)The Converse Theorem
If a² + b² = c² in a triangle (where c is the longest side), then the triangle IS a right triangle. This lets you verify right angles by measuring sides only.
Generalization: Law of Cosines
For non-right triangles:
c² = a² + b² - 2ab x cos(C)If C = 90°, then cos(C) = 0 and it reduces to the Pythagorean theorem.
Common Mistakes
1. Applying it to non-right triangles: only works with a 90-degree angle. For others, use the Law of Cosines.
2. Confusing legs with hypotenuse: the hypotenuse is ALWAYS the longest side, opposite the right angle.
3. Forgetting the square root: c² = a² + b², so c = sqrt(a² + b²) (not a + b).
4. Adding before squaring: (a + b)² != a² + b². Square each leg separately, then add.
5. Mixing units: if one leg is in meters and another in centimeters, convert first.
Frequently asked questions
Does the Pythagorean Theorem work for any triangle?
No. It only works for right triangles (one angle must be exactly 90 degrees). For obtuse or acute triangles, use the Law of Cosines: c² = a² + b² - 2ab x cos(C). The Pythagorean theorem is a special case of the Law of Cosines when C = 90 degrees (because cos(90) = 0).
How do I know if a triangle is a right triangle without measuring angles?
Use the converse theorem. If a² + b² = c² where c is the longest side, then the triangle is a right triangle. Example: triangle with sides 5, 12, 13. Check: 5² + 12² = 25 + 144 = 169 = 13². Confirmed. Very useful in construction for verifying walls are square.
What is a Pythagorean triple?
A set of three positive integers that satisfy a² + b² = c². The most famous: (3,4,5), (5,12,13), (8,15,17), (7,24,25). Multiplying any triple by an integer k gives another triple: (6,8,10), (9,12,15), etc. They can be generated with Euclid's formula: a = m²-n², b = 2mn, c = m²+n².
What is the diagonal of a 55-inch TV?
55 inches IS the diagonal (that's how TV size is measured). To find width and height for 16:9 aspect ratio: divide diagonal by sqrt(16² + 9²) = sqrt(337) = 18.36, then multiply by 16 for width and by 9 for height. Result: width = 47.9" = 121.7 cm, height = 27" = 68.5 cm.
How do I use the theorem for a ladder against a wall?
The ladder is the hypotenuse. The height it reaches is one leg. The distance from the base to the wall is the other leg. If the ladder is 5 m long and placed 1 m from the wall, height = sqrt(5² - 1²) = sqrt(24) = 4.9 m. For safety, the recommended angle is 75 degrees from the ground, which means base = height / 4.
Does the Pythagorean theorem work in 3 dimensions?
Yes, with an extension. The 3D distance between points (x1,y1,z1) and (x2,y2,z2) is d = sqrt((x2-x1)² + (y2-y1)² + (z2-z1)²). It's proven by applying the theorem twice (first in XY plane, then incorporating Z). Also useful for calculating the diagonal of a box: d = sqrt(length² + width² + height²).
Who discovered the Pythagorean theorem?
Pythagoras of Samos (ca. 570-495 BC) gets the credit, but the Babylonians were using Pythagorean triples 1,000 years earlier (Plimpton 322 tablet, ca. 1800 BC). The Egyptians and Chinese also knew it empirically. What Pythagoras (or his school) contributed was the first general proof, transforming it from a practical rule into a mathematical theorem.
How many proofs of the Pythagorean theorem exist?
Over 370 distinct proofs. They include geometric versions (with squares and rearrangement), algebraic proofs, proofs using vectors, trigonometry, calculus, complex numbers, and even one by US President James Garfield in 1876. The book The Pythagorean Proposition by Elisha Scott Loomis (1927) catalogs 367. It's the theorem with the most distinct proofs in all of mathematics.