Explanation
The Pythagorean theorem
In a right triangle, the square of the hypotenuse equals the sum of the squares of the two perpendicular legs. Choose exactly which kind of side is missing; all entered lengths are metres and the answer is also in metres.
c² = a² + b²; c = √(a² + b²)
| a | leg a, in metres (metres (m)) |
|---|---|
| b | leg b, in metres (metres (m)) |
| c | hypotenuse c, in metres, opposite the right angle (metres (m)) |
a² + b² = c²; b = √(c² − a²), with c > a
| a | leg a, in metres (metres (m)) |
|---|---|
| b | leg b, in metres (metres (m)) |
| c | hypotenuse c, in metres, opposite the right angle (metres (m)) |
The 3–4–5 right triangle
| Leg a | 3 |
|---|---|
| Leg b | 4 |
| Result | 5 m |
c = √(3² + 4²) = 5 m
Given hypotenuse 5 m and leg 3 m
| Hypotenuse c | 5 |
|---|---|
| Known leg a | 3 |
| Result | 4 m |
b = √(5² − 3²) = 4 m
A scaled 5–12–13 triangle
| Leg a | 5 |
|---|---|
| Leg b | 12 |
| Result | 13 m |
c = √(5² + 12²) = 13 m
A right triangle with 1.5 m and 2 m legs
| Leg a | 1.5 |
|---|---|
| Leg b | 2 |
| Result | 2.5 m |
c = √(1.5² + 2²) = 2.5 m
Diagram of this result
The right triangle is drawn in the proportions of its sides. Legs a and b meet at the right angle; the side you solved for is drawn in the accent colour.
The diagram represents a right triangle: a and b are perpendicular legs, c is the hypotenuse opposite the right angle. The solved side is labeled from the same calculation result.
Common mistakes
The hypotenuse is always opposite the right angle and is strictly longer than either leg. Do not apply the formula to a non-right triangle. When solving for a leg, subtract the known leg's square from the hypotenuse's square; reversing the subtraction makes the radicand negative. Do not compare side lengths by rounding first: the feasibility check is exact on the canonical decimal inputs.
Assumptions and precision
Exactly one side is missing. Given sides must be positive finite canonical decimals, up to 30 significant digits and adjusted exponent magnitude 100. For a missing leg, the input hypotenuse must be strictly greater than the known leg; equality is degenerate and rejected without a tolerance. Decimal arithmetic and square roots use 50 significant digits, with no intermediate presentation rounding. Root results are approximate; fixtures use 1e-12 relative plus 1e-12 absolute tolerance. Inputs and output are explicitly metres.
How do I identify the hypotenuse?
It is the side opposite the right-angle corner and is the longest side in a nondegenerate right triangle. The two sides that form the right angle are the legs.
Why is an equal hypotenuse and leg rejected?
If c equals a, then b² = c² − a² = 0, so the remaining leg has zero length and the triangle is degenerate, not a valid triangle with positive sides.
References
For right-triangle geometry and the Pythagorean theorem, see OpenStax Prealgebra 2e, geometry topics: https://openstax.org/details/books/prealgebra-2e. The theorem and worked examples are checked against the identity a² + b² = c² using independent arithmetic fixtures.