CalcMountain

Pythagorean Theorem Calculator

Enter two sides of a right triangle to calculate the missing side using the Pythagorean theorem. Choose whether you are solving for a leg or the hypotenuse.

The Pythagorean theorem is one of the most famous results in mathematics: in any right triangle, the square of the hypotenuse equals the sum of squares of the other two sides. Written algebraically: a² + b² = c², where c is the hypotenuse (longest side, opposite the right angle) and a, b are the two legs. This 2500-year-old theorem, attributed to Pythagoras (c. 570-495 BC), underlies coordinate geometry, distance calculations, trigonometry, and countless practical applications.

The theorem works in only one direction: any right triangle satisfies the equation. Conversely, any three positive numbers a, b, c satisfying a² + b² = c² can be the sides of a right triangle (the converse). This bidirectional truth is what makes the theorem so powerful.

Famous "Pythagorean triples" — integer solutions to a² + b² = c² — appear throughout geometry: 3-4-5, 5-12-13, 8-15-17, 7-24-25, 20-21-29. These triples have been studied for thousands of years and remain useful for clean-number examples.

The theorem extends to: - **Distance formula**: distance between two points = √((x₂-x₁)² + (y₂-y₁)²) (Pythagorean applied to coordinates). - **3D space**: space diagonal = √(a² + b² + c²). - **Vectors**: magnitude = √(x² + y² + ...). - **Complex numbers**: modulus |a + bi| = √(a² + b²).

Common applications: construction (squaring corners), navigation, surveying, computer graphics, physics (vector magnitudes), trigonometry (foundation), and any problem involving right-triangle geometry.

Inputs

Results

Missing Side

5

Hypotenuse (c)

5

Leg a

3

Leg b

4

Triangle Area

6

Perimeter

12

Last updated:

Formula

**Pythagorean Theorem:** a² + b² = c² Where: - a, b = the two legs (sides adjacent to the right angle) - c = the hypotenuse (side opposite the right angle, always longest) **Solving for hypotenuse:** c = √(a² + b²) **Solving for a leg:** a = √(c² - b²) b = √(c² - a²) **Worked example: find hypotenuse** a = 3, b = 4. Find c. c² = 9 + 16 = 25. c = 5. This is the famous 3-4-5 right triangle. **Worked example: find a leg** c = 13, a = 5. Find b. b² = 169 - 25 = 144. b = 12. This is the 5-12-13 right triangle. **Common Pythagorean triples:** | a | b | c | Notes | |---|---|---|---| | 3 | 4 | 5 | classic example | | 5 | 12 | 13 | | | 7 | 24 | 25 | | | 8 | 15 | 17 | | | 9 | 40 | 41 | | | 12 | 35 | 37 | | | 20 | 21 | 29 | | | 6 | 8 | 10 | = (3,4,5) × 2 | | 9 | 12 | 15 | = (3,4,5) × 3 | | 15 | 20 | 25 | = (3,4,5) × 5 | **Verifying right triangles:** For sides 6, 8, 10: 6² + 8² = 36 + 64 = 100 = 10². Yes! Right triangle. For sides 5, 7, 9: 5² + 7² = 25 + 49 = 74. 9² = 81. 74 ≠ 81. Not a right triangle (in fact, obtuse since 81 > 74). **Distance formula (Pythagorean in coordinates):** For points (x₁, y₁) and (x₂, y₂): d = √((x₂-x₁)² + (y₂-y₁)²) The horizontal difference (Δx) and vertical difference (Δy) form the legs; distance is hypotenuse. **3D extension:** For 3D space (or rectangular box space diagonal): d² = a² + b² + c² d = √(a² + b² + c²) Cube of side s: space diagonal = s√3. **n-dimensional:** d = √(x₁² + x₂² + ... + xₙ²) Generalized Pythagorean theorem. **Connection to trigonometry:** For right triangle with hypotenuse 1: sin(θ) = opposite/hypotenuse = leg/1 cos(θ) = adjacent/hypotenuse = leg/1 sin²(θ) + cos²(θ) = 1. This identity comes directly from Pythagorean theorem. **Law of Cosines (generalization):** For any triangle (not just right): c² = a² + b² - 2ab × cos(C). When C = 90° (right): cos(C) = 0, and formula reduces to c² = a² + b² (Pythagorean). Pythagorean is the special case of Law of Cosines for right triangles. **Practical applications:** **Construction: squaring corners.** For 90° corner: measure 3 units along one side, 4 along the other; diagonal should be 5 units. If 5: square (right angle). If not: adjust. Used for centuries in carpentry, masonry. "3-4-5 method". **TV size measurement:** TV size = diagonal length. For 16:9 aspect ratio 32" TV: diagonal = 32". Width = 27.9", height = 15.7" (using aspect ratio + Pythagorean). **Roof pitch:** For roof span 20 ft, rise 5 ft (5/12 pitch): Rafter length = √(10² + 5²) = √125 ≈ 11.18 ft (each side from peak). **Indirect measurement:** Tall building height from distance and angle of elevation: height = distance × tan(angle). Uses right triangle trigonometry, founded on Pythagorean. **Generating Pythagorean triples:** For positive integers m > n: a = m² - n² b = 2mn c = m² + n² Always Pythagorean triple. For m=2, n=1: a=3, b=4, c=5. For m=3, n=2: a=5, b=12, c=13. For m=4, n=1: a=15, b=8, c=17. **Famous triples (memorize):** 3-4-5 (most common) 5-12-13 7-24-25 8-15-17 Multiples also work: 6-8-10, 9-12-15, etc. **History:** - Ancient knowledge: Babylonians (1900 BC) had Pythagorean triple lists. - Egyptians used 3-4-5 for surveying. - Chinese (1100 BC): Zhou Bi Suan Jing geometric proof. - Pythagoras (570-495 BC): credited with first formal proof. - Euclid: included in Elements as Proposition 47. - Over 370 distinct proofs known today. **Worked example: ladder against wall** Ladder 10 ft long, base 6 ft from wall. How high on wall? Ladder is hypotenuse: 10. Base distance: 6. Height = √(100 - 36) = √64 = 8 ft. OSHA recommends 4:1 ratio (height:distance), so 8 ft up needs 2 ft base. With 6 ft base for 8 ft height, ladder is too shallow — unstable. **Software:** - **Calculators**: simple formula. - **CAD packages**: built into geometry tools. - **Python**: math.sqrt(a**2 + b**2). - **Excel**: =SQRT(A1^2 + B1^2). - **Surveying instruments**: built-in distance calculation. **Pitfalls:** - **Confusing hypotenuse with leg**: hypotenuse always longest, opposite right angle. - **Forgetting to square root**: a² + b² = c² → c = √(a² + b²). - **Using on non-right triangles**: only works for right triangles. Use Law of Cosines otherwise. - **Sign confusion**: take positive square root (sides are positive). - **Distance formula vs Pythagorean**: same idea, different setup. **Common applications:** - **Construction**: squaring corners, roof pitches. - **Navigation**: distance between points. - **Computer graphics**: distance calculations. - **Physics**: vector magnitudes. - **Astronomy**: triangulating distances. - **Surveying**: indirect measurement. - **GPS**: trilateration with distances. - **Sports**: trajectory and distance analysis. **Tests for right triangle:** If sides satisfy a² + b² = c²: right triangle. If a² + b² > c²: acute triangle (smaller than right). If a² + b² < c²: obtuse triangle (larger than right). Useful for determining angle classification from sides. **Pythagorean theorem in physics:** - **Velocity**: speed = √(vₓ² + vᵧ²) for 2D motion. - **Force**: |F| = √(Fₓ² + Fᵧ²). - **Distance traveled**: by components and resultant. Vector mathematics generalizes Pythagorean to all physical quantities. **Pitfalls:** - **Always positive sides**: take positive square root. - **Hypotenuse identification**: opposite right angle, longest side. - **Not all triples are integers**: most have decimal sides. - **For non-right triangles**: use Law of Cosines or Law of Sines. - **3D vs 2D**: include all dimensions.

How to use this calculator

  1. Choose: solve for hypotenuse or solve for leg.
  2. Enter the two known sides.
  3. Calculator returns the missing side.
  4. For hypotenuse: c = √(a² + b²).
  5. For leg: a = √(c² - b²).
  6. Verify: a² + b² should equal c² for right triangle.

Worked examples

TV diagonal

**Scenario:** 16:9 aspect ratio TV with width 32" and height 18". What's the diagonal (TV size)? **Calculation:** diagonal = √(32² + 18²) = √(1024 + 324) = √1348 ≈ 36.7". **Result:** ~37" diagonal TV. TV sizes are diagonal measurements. For exact 32" TV: width = 32 × 16/√(16² + 9²) ≈ 27.9"; height ≈ 15.7".

Ladder against wall

**Scenario:** 12 ft ladder. Base 4 ft from wall. How high does it reach? **Calculation:** height = √(12² - 4²) = √(144 - 16) = √128 ≈ 11.3 ft. **Result:** ~11.3 ft. Safe placement check: OSHA recommends ladder angle ~75° (ratio 1:4, base:height). Ratio here: 4:11.3 ≈ 1:2.8, much steeper. With 4 ft base, ladder is fairly steep — could be safer with bigger base distance.

Construction corner check

**Scenario:** Building a deck corner. Want to verify 90° angle. Measure 3 ft along one wall, 4 ft along other. Diagonal should be? **Calculation:** Diagonal = √(3² + 4²) = √25 = 5 ft. **Result:** If diagonal is exactly 5 ft, corner is 90°. If not, adjust. "3-4-5 method" — used by carpenters for centuries to verify square corners without complex tools.

When to use this calculator

**Use the Pythagorean theorem for:**

- **Finding missing sides** of right triangles. - **Distance calculations** between points (uses formula derived from theorem). - **Construction**: verifying right angles, sizing diagonal braces. - **Navigation**: straight-line distances. - **Computer graphics**: pixel distances, collision detection. - **Physics**: vector magnitudes (velocity, force). - **Roof and stair design**: rise/run/diagonal calculations. - **Trigonometry**: foundation for sin, cos, tan in right triangles.

**Only for right triangles:**

Pythagorean theorem works ONLY for right triangles. For other triangles: - **Law of Cosines**: c² = a² + b² - 2ab cos(C). - **Law of Sines**: a/sin(A) = b/sin(B) = c/sin(C).

Pythagorean is the special case when C = 90°.

**Identifying the hypotenuse:**

The hypotenuse is: - Always opposite the right angle. - Always the longest side. - Labeled "c" in standard notation.

The other two sides (legs, a and b) are adjacent to the right angle.

**Common Pythagorean triples to recognize:**

- 3-4-5 (and multiples: 6-8-10, 9-12-15, ...) - 5-12-13 (and multiples) - 7-24-25 - 8-15-17

Recognizing these saves calculation time.

**Generating new triples:**

For positive integers m > n: - a = m² - n² - b = 2mn - c = m² + n²

Examples: (m,n) = (2,1) → (3,4,5). (3,2) → (5,12,13). (4,1) → (15,8,17).

**Common applications:**

- **Construction**: verifying square corners, roof rafters, stair stringers. - **Carpentry**: diagonal bracing, frame squareness. - **Surveying**: indirect distance measurement. - **Architecture**: blueprint distances, room diagonals. - **Navigation**: straight-line ("as the crow flies") distances. - **Computer graphics**: pixel-distance calculations. - **Physics**: 2D vector resultant magnitudes. - **GPS/Mapping**: distance approximations. - **Sports**: trajectory analysis (e.g., baseball, golf).

**3D extension:**

For 3D coordinates: d = √((x₂-x₁)² + (y₂-y₁)² + (z₂-z₁)²)

Used in: - 3D graphics. - Astronomy. - Robotics. - Aerospace.

**Connection to other math:**

- **Trigonometry**: sin² + cos² = 1 (special case). - **Law of Cosines**: generalization to any triangle. - **Distance formula**: Pythagorean in coordinate plane. - **Vector magnitude**: |v| = √(sum of squares). - **Complex modulus**: |a + bi| = √(a² + b²).

**Software:**

- **Calculator**: simple formula. - **Excel**: =SQRT(A1^2 + B1^2). - **Python**: math.sqrt(a**2 + b**2) or math.hypot(a, b). - **CAD**: built into distance and dimension tools. - **GIS**: distance calculations.

**Why "Pythagorean"?**

Attributed to Pythagoras (Greek mathematician, 570-495 BC) who reportedly proved the theorem. But it was known earlier — Babylonian tablets (c. 1900 BC) list Pythagorean triples. Several Chinese, Indian, and Egyptian texts include proofs. Pythagoras gets credit for first deductive proof in Western mathematics.

**Number of proofs:**

Over 370 distinct proofs of Pythagorean theorem exist — geometric, algebraic, trigonometric. Includes proofs by President James Garfield (1881) and Einstein (as a teenager).

**Pitfalls:**

- **Using on non-right triangles**: only works for right triangles. - **Wrong identification of hypotenuse**: must be opposite right angle. - **Forgetting to take square root**: result is c², not c. - **Subtracting wrong side**: for leg, subtract from hypotenuse squared. - **For decimals**: most triangles have irrational hypotenuse. - **3D vs 2D**: include z-coordinate when needed. - **Confusing with distance formula**: same idea, different setup.

Common mistakes to avoid

  • Applying Pythagorean theorem to non-right triangles.
  • Confusing the hypotenuse (longest side, opposite right angle) with a leg.
  • Forgetting to take the square root at the end.
  • For solving for a leg: subtracting in wrong direction.
  • Using on triangle with three given sides without verifying it's right.
  • Mixing units (e.g., legs in cm, hypotenuse in m).
  • For 3D problems: forgetting the z-component.
  • For distance formula: forgetting to square both differences.

Frequently Asked Questions

Sources & further reading

SponsoredShop Top Deals on AmazonSupport CalcMountain — browse top-rated products at no extra cost to you.

Related Calculators