The Standard Engine.
MathematicsFinanceHealthPhysicsEngineeringBrowse all

Mathematics · Geometry & Trigonometry · Plane Geometry

Pythagorean Theorem Calculator

Calculates the unknown side of a right triangle given any two sides using the Pythagorean theorem.

Calculator

Advertisement

Formula

In a right triangle, c is the hypotenuse (the side opposite the right angle), while a and b are the two legs. Given any two sides, the third can be found: if solving for a leg, rearrange to a = \sqrt{c^2 - b^2}.

Source: Euclid, Elements, Book I, Proposition 47 (c. 300 BCE); reaffirmed in any standard geometry textbook such as Coxeter & Greitzer, Geometry Revisited, MAA, 1967.

How it works

The Pythagorean theorem states that in any right triangle, the square of the hypotenuse equals the sum of the squares of the two legs. This relationship has been known independently across many ancient cultures — Babylonian clay tablets from around 1800 BCE contain Pythagorean triples — and was formally proved by Euclid around 300 BCE. The theorem is foundational to Euclidean geometry and underlies countless applications in science, engineering, and navigation.

The core formula is c² = a² + b², where c is the hypotenuse (the longest side, always opposite the 90° angle) and a and b are the two shorter sides, called legs. To solve for the hypotenuse, compute c = √(a² + b²). To find a missing leg, rearrange: a = √(c² − b²), or b = √(c² − a²). Note that the expression under the square root must be positive; if c is smaller than the known leg, no real solution exists and the inputs do not form a valid right triangle.

Beyond finding the unknown side, this calculator also computes the triangle's area — always equal to half the product of the two legs (Area = ½ × a × b) — and the perimeter (the sum of all three sides). These values are immediately useful in carpentry, construction layout, land surveying, computer graphics, and any field where right-angle geometry arises. Pythagorean triples (integer solutions such as 3-4-5, 5-12-13, and 8-15-17) are especially handy in practical work because they guarantee a perfect right angle with no rounding.

Worked example

Example 1 — Finding the hypotenuse (classic 3-4-5 triangle):

A carpenter needs to confirm a right angle in a rectangular floor frame. One wall measures 3 m and the adjacent wall measures 4 m. What should the diagonal (hypotenuse) measure?

Step 1: Square both legs — 3² = 9, 4² = 16.

Step 2: Sum the squares — 9 + 16 = 25.

Step 3: Take the square root — √25 = 5 m.

The diagonal must be exactly 5 m. If the measured diagonal equals 5 m, the corner is a perfect right angle.

Example 2 — Finding a missing leg:

A ladder of length 10 ft leans against a wall. The base of the ladder is 6 ft from the wall. How high up the wall does the ladder reach?

Step 1: Identify the known values — hypotenuse c = 10 ft, one leg b = 6 ft.

Step 2: Apply the rearranged formula — a = √(c² − b²) = √(100 − 36) = √64 = 8 ft.

The ladder reaches 8 ft up the wall. The triangle's area is ½ × 6 × 8 = 24 sq ft, and the perimeter is 6 + 8 + 10 = 24 ft.

Limitations & notes

This calculator applies strictly to right triangles — triangles containing exactly one 90° angle. It cannot be used for acute or obtuse triangles; use the Law of Cosines for general triangles instead. All input values must be positive real numbers; negative or zero side lengths have no geometric meaning. When solving for a leg, the hypotenuse must be strictly greater than the other known leg, otherwise the square root of a negative number is required and no real solution exists. Results are computed in floating-point arithmetic, so very large or very small values may accumulate rounding errors; for high-precision engineering work, verify results with dedicated CAD or surveying software. The calculator also assumes a flat (Euclidean) plane — the theorem does not hold on curved surfaces such as a sphere, where spherical trigonometry must be used instead.

Frequently asked questions

What is the Pythagorean theorem formula?

The Pythagorean theorem states that c² = a² + b², where c is the hypotenuse and a and b are the two legs of a right triangle. To find the hypotenuse, compute c = √(a² + b²). To find a missing leg, rearrange to a = √(c² − b²).

What are Pythagorean triples and why are they useful?

Pythagorean triples are sets of three positive integers that satisfy a² + b² = c². Common examples include 3-4-5, 5-12-13, 8-15-17, and 7-24-25. They are extremely useful in construction and surveying because they produce perfect right angles using only integer measurements, eliminating rounding errors.

Can the Pythagorean theorem be used for non-right triangles?

No. The Pythagorean theorem applies only to right triangles. For triangles without a 90° angle, use the Law of Cosines: c² = a² + b² − 2ab·cos(C), where C is the included angle. The Law of Cosines reduces to the Pythagorean theorem when C = 90°, since cos(90°) = 0.

How do I check if three side lengths form a right triangle?

Arrange the three sides so the longest is c, and check whether a² + b² = c². For example, sides 5, 12, and 13: 5² + 12² = 25 + 144 = 169 = 13². Since this holds exactly, the triangle is a right triangle. If the sum is greater than c², the triangle is acute; if less, it is obtuse.

Does the Pythagorean theorem work in three dimensions?

Yes — the theorem extends naturally to 3D. The space diagonal d of a rectangular box with dimensions a, b, and c is given by d = √(a² + b² + c²). This is derived by applying the 2D theorem twice: first to the base diagonal, then to the full space diagonal.

Last updated: 2025-01-15 · Formula verified against primary sources.