Of the three sides a, b and c of a right triangle (c is the hypotenuse), enter only the two you know. The Pythagorean theorem gives the missing side, and the two acute angles, the area, the perimeter and the altitude to the hypotenuse are shown too.
Table of Contents
-
What you can do on this page
-
What is this calculation used for?
-
How to Use
-
Formulas and figures
-
Symbols and terms
-
Good to know before you start
-
How to calculate it in Excel
-
How to calculate it in Google Sheets
-
How to calculate it in Python
-
How to write it in LaTeX and other math languages (copy and paste)
-
How to have ChatGPT do the calculation
-
DataChef Features
-
Related Features
-
NumberChef Calculators List
What you can do on this page
- Enter any two of the three sides of a right triangle, and the Pythagorean theorem \(a^2 + b^2 = c^2\) gives you the third side on the spot
- Questions like "I only know it is 3 ft one way and 4 ft the other. How long is the diagonal?" are answered in one step
- Along with the missing side, it also finds the two acute angles, the area, the perimeter and the altitude to the hypotenuse, with the steps shown
- A plain-language explanation of the formulas and copy-and-paste formulas for Excel, Google Sheets and Python are all on this page
What is this calculation used for?
If you lean a 16-foot ladder against a wall with its feet 4 feet from the wall, it reaches \(\sqrt{16^2 - 4^2} = \sqrt{240} \approx 15.49\) feet up the wall (about 15.5 ft).
A ladder is set with its feet away from the wall so it does not tip over (a common safety rule is 1 foot out for every 4 feet of height), so it never reaches as high as its full length. Estimating the reach this way before the job is a basic habit in construction and electrical work.
Measure 3 feet along one side and 4 feet along the other. If the distance between those two marks is exactly 5 feet, the corner is square (since \(3^2 + 4^2 = 5^2\), the converse of the Pythagorean theorem says it is a right angle). For bigger layouts, carpenters use 6-8-10 or 9-12-15.
This "3-4-5 method" has been used for thousands of years, from rope stretchers in ancient Egypt to today's foundation and deck layouts. It is the most practical everyday use of the Pythagorean theorem.
A place 3 miles east and 4 miles north of you is \(\sqrt{3^2 + 4^2} = 5\) miles away in a straight line.
Finding the distance between two points from the east-west difference and the north-south difference (the distance formula) is the Pythagorean theorem itself. It runs inside almost every program that works with locations, such as GPS navigation, map apps and video games.
A staircase that runs 12 feet horizontally and rises 9 feet has a sloped length of \(\sqrt{12^2 + 9^2} = \sqrt{225} = 15\) feet.
The length of any sloped part, such as a stair handrail or a ramp board, comes from the horizontal and vertical dimensions on the plan with the Pythagorean theorem. You can use it directly to estimate materials before going to the store.
Formulas and figures
Symbols and terms
Symbols
| \(a\), \(b\) | a, b | The lengths of the two legs, the sides that form the right angle. It does not matter which one you call a; the result is the same. |
| \(c\) | c | The length of the hypotenuse, the longest side of a right triangle, opposite the right angle. |
| \(a^2\) | a squared | A number multiplied by itself (\(a^2 = a \times a\)). The small raised 2 is an exponent that says "use it as a factor twice". (Example - \(3^2 = 3 \times 3 = 9\)) |
| \(\sqrt{\phantom{x}}\) | square root (radical sign) | The symbol for a square root. \(\sqrt{25}\) is the positive number that gives 25 when squared, which is 5. It can also be a number that never ends as a decimal, like \(\sqrt{2}\) (about 1.414). |
| \(\alpha\), \(\beta\) | alpha, beta | Greek letters often used to name angles. On this page, \(\alpha\) is the angle opposite leg a and \(\beta\) is the angle opposite leg b, and \(\alpha + \beta = 90°\). |
| \(\arcsin\) | arcsine | The inverse of the sine ratio \(\sin\) (opposite side ÷ hypotenuse). It works back from the ratio to the angle. This calculator finds the angles with it. On a scientific calculator it is the sin⁻¹ key. |
| \(h\) | h | The altitude to the hypotenuse - the height from the right-angle vertex to the hypotenuse, with the hypotenuse as the base. It is the first letter of "height". |
Terms
| Pythagorean theorem | The theorem that the three sides of a right triangle satisfy \(a^2 + b^2 = c^2\) (c is the hypotenuse). It is named after the ancient Greek mathematician Pythagoras (around the 6th century BC). It is taught in Grade 8 math. |
| leg | One of the two sides of a right triangle that form the right angle. The two legs are usually called a and b, and they are always shorter than the hypotenuse. |
| right triangle | A triangle in which one of the three angles is exactly 90° (a right angle). The Pythagorean theorem works only for this shape. |
| hypotenuse | The side of a right triangle opposite the right angle. It is the longest of the three sides, and in the Pythagorean theorem its square always stands alone on one side of the equation. |
| square root | A number that gives the original number when squared. The positive square root of 25 is 5, and the square root of 2 is \(\sqrt{2} \approx 1.414\). Square roots are taught in Grade 8. |
| Pythagorean triple | A set of three whole numbers that satisfy the Pythagorean theorem. (3, 4, 5), (5, 12, 13) and (8, 15, 17) are well known. They show up often in practice problems and when builders lay out square corners. |
| converse of the Pythagorean theorem | The theorem that a triangle whose three sides satisfy \(a^2 + b^2 = c^2\) is a right triangle. By measuring only the sides, you can check whether an angle is a right angle, so it is used on real construction sites. |
Good to know before you start
Here is what helps you use the calculation on this page with real understanding, not just by pressing the button.
| Squares and exponents (Grade 6) |
|
| Square roots (Grade 8) |
|
| Triangle basics (Grades 4–6) |
|
| The Pythagorean theorem (Grade 8) |
|
How to calculate it in Excel
| Leg a | 3 |
| Leg b | 4 |
| Hypotenuse c | 5 |
| Value of a²+b² | =B1^2+B2^2 |
| Value of c² | =B3^2 |
| Leg a | 3 |
| Leg b | 4 |
| Hypotenuse c | =SQRT(B1^2+B2^2) |
| Hypotenuse c | 13 |
| Known leg a | 5 |
| Missing leg b | =SQRT(B1^2-B2^2) |
| Leg a | 3 |
| Leg b | 4 |
| Hypotenuse c | 5 |
| Altitude h | =B1*B2/B3 |
"^2" squares a number, and "SQRT(…)" is the Excel function for the square root.
In the first table, if the value of a²+b² (B4) and the value of c² (B5) are equal, the triangle is a right triangle (for the example 3, 4, 5, both are 25).
In the second table, B3 shows the hypotenuse, 5. Just replace the input numbers with your own side lengths.
How to calculate it in Google Sheets
| Leg a | 3 |
| Leg b | 4 |
| Hypotenuse c | 5 |
| Value of a²+b² | =B1^2+B2^2 |
| Value of c² | =B3^2 |
| Leg a | 3 |
| Leg b | 4 |
| Hypotenuse c | =SQRT(B1^2+B2^2) |
| Hypotenuse c | 13 |
| Known leg a | 5 |
| Missing leg b | =SQRT(B1^2-B2^2) |
| Leg a | 3 |
| Leg b | 4 |
| Hypotenuse c | 5 |
| Altitude h | =B1*B2/B3 |
How to calculate it in Python
import math
side_a = 3.0 # leg a
side_b = 4.0 # leg b
hypotenuse = math.sqrt(side_a ** 2 + side_b ** 2) # hypotenuse c (math.hypot(side_a, side_b) gives the same)
area = side_a * side_b / 2 # area
perimeter = side_a + side_b + hypotenuse # perimeter
height = side_a * side_b / hypotenuse # altitude to the hypotenuse
angle_alpha = math.degrees(math.asin(side_a / hypotenuse)) # angle opposite leg a (degrees)
print(f"Hypotenuse c: {hypotenuse}")
print(f"Area: {area}")
print(f"Perimeter: {perimeter}")
print(f"Altitude to the hypotenuse: {height}")
print(f"Angle alpha: {angle_alpha}")
# If you know the hypotenuse c and leg a, find the missing leg b with
# side_b = math.sqrt(hypotenuse ** 2 - side_a ** 2)
How to write it in LaTeX and other math languages (copy and paste)
a² + b² = c²
a^2 + b^2 = c^2
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mrow>
<msup><mi>a</mi><mn>2</mn></msup>
<mo>+</mo>
<msup><mi>b</mi><mn>2</mn></msup>
<mo>=</mo>
<msup><mi>c</mi><mn>2</mn></msup>
</mrow>
</math>
a^2 + b^2 = c^2
a^2 + b^2 == c^2
a^2 + b^2 = c^2;
a^2 + b^2 == c^2
a^2 + b^2 = c^2
c = √(a² + b²)
c = \sqrt{a^2 + b^2}
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mrow>
<mi>c</mi>
<mo>=</mo>
<msqrt>
<mrow>
<msup><mi>a</mi><mn>2</mn></msup>
<mo>+</mo>
<msup><mi>b</mi><mn>2</mn></msup>
</mrow>
</msqrt>
</mrow>
</math>
c = sqrt(a^2 + b^2)
Sqrt[a^2 + b^2]
c := sqrt(a^2 + b^2);
c = sqrt(a^2 + b^2);
c = √(a^2 + b^2)
b = √(c² − a²)
b = \sqrt{c^2 - a^2}
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mrow>
<mi>b</mi>
<mo>=</mo>
<msqrt>
<mrow>
<msup><mi>c</mi><mn>2</mn></msup>
<mo>−</mo>
<msup><mi>a</mi><mn>2</mn></msup>
</mrow>
</msqrt>
</mrow>
</math>
b = sqrt(c^2 - a^2)
Sqrt[c^2 - a^2]
b := sqrt(c^2 - a^2);
b = sqrt(c^2 - a^2);
b = √(c^2 - a^2)
h = a × b ÷ c
h = \frac{ab}{c}
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mrow>
<mi>h</mi>
<mo>=</mo>
<mfrac>
<mrow><mi>a</mi><mi>b</mi></mrow>
<mi>c</mi>
</mfrac>
</mrow>
</math>
h = (a b)/c
a*b/c
h := a*b/c;
h = a*b/c;
h = ab/c
How to have ChatGPT do the calculation
You are a geometry calculation assistant. Do the following calculation by actually running Python code, and base your answer only on the numbers from the execution result (do not answer by mental math or guessing). In a right triangle, the two legs are a = 3 and b = 4. Find each of the following: 1. The length of the hypotenuse c (Pythagorean theorem c = √(a² + b²)) 2. Angle α (opposite leg a) and angle β (opposite leg b) in degrees 3. The area and the perimeter 4. The altitude to the hypotenuse h = ab ÷ c Show the formulas you used and the numbers from the execution result.
How to Use
-
1Enter your numbersType the numbers you want to calculate with into the input fields
-
2CalculatePress the "Calculate" button
-
3Check the resultThe result appears on the spot. The same page also explains the idea behind the calculation and the formula
DataChef Features
No technical knowledge required.
Intuitive and user-friendly operation.
Can be used without registering personal information.
Automatic file deletion by clicking "download".
and rapid file conversion.
No attribution required.
No need to contact us for commercial use permission.
