Back to the blog

Pythagoras' theorem · 10 min read

Pythagoras in the plane and in space

Why a² + b² = c² is true, how to work out a side, how to check for a right angle, and how to find distances and space diagonals.

Lean a ladder against a wall. The ladder, the wall and the ground form a triangle with a right angle. Pythagoras' theorem is about triangles like that. If you know two sides, you can work out the third.

First you see why the theorem is true. Then you use it in four situations, from a flat plane to a box.

Spotting the hypotenuse

A right triangle has one angle of 90°. In a drawing you mark it with a small square.

  • The two sides that form the right angle are the legs. We call them a and b.
  • The side across from the right angle is the hypotenuse. We call it c.

The hypotenuse is always the longest side. Turn the triangle below. It lies differently each time, but c stays across from the small square.

Turn the triangle
  • Legs a and b
  • Hypotenuse c
a = 3b = 4c = 5
A triangle with sides 3, 4 and 5. The small square marks the right angle.

Why a² + b² = c²

Draw a square on each side. The square on side a has area a². In the same way you get b² and c². Pythagoras' theorem says:

a² + b² = c²

In words: the squares on the two legs together are as big as the square on the hypotenuse.

Drag the two corners, or use the sliders. The triangle starts with a = 3 and b = 4.

Drag the corners
  • Square on a
  • Square on b
  • Square on the hypotenuse c
a²9b²16c²25
a² + b²
3² + 4² = 9 + 16 = 25
c
√25 = 5
Each cell is 1 by 1. The two small squares together are always as big as the large one.
Show the numbers
SideLengthArea
a39
b416
c525
  • With a = 3 and b = 4 you count 9 and 16 cells. Together that is 25. The large square has 25 cells too, so c = 5.
  • With a = 1 and b = 2, c² = 1 + 4 = 5. Then c = √5 ≈ 2.24. That is not a whole number, but the areas still add up.

The proof with four triangles

A few examples do not prove anything yet. This proof works for every right triangle.

Take a large square with side a + b. Place four copies of the same triangle in it, with legs a and b. There are two ways to do that. Tap the buttons to switch.

Why it always works
c²a²b²abab

Left over: one tilted square, c².

A square with side a + b and four copies of the same right triangle.
  • With the triangles in the corners, a tilted square is left in the middle. Its sides are hypotenuses, so its area is c².
  • With the triangles in pairs, two squares are left. One is a by a and one is b by b. Together that is a² + b².

The large square is the same both times. So are the four triangles. So what is left over is the same size too: c² = a² + b².

The tilted piece really is a square. At each of its corners lie the two acute angles of the triangle. Together they make 90°, because the three angles of a triangle add up to 180°. A straight angle is also 180°. So the corner of the middle piece gets 180° − 90° = 90°.

Working out a side

The hypotenuse

The legs are 6 and 8. How long is the hypotenuse? Write each step on a new line.

c² = a² + b²
c² = 6² + 8²
c² = 36 + 64
c² = 100
c = √100 = 10

The hypotenuse is 10. Check: 10 is longer than 6 and longer than 8, but shorter than 6 + 8 = 14.

Often the answer is not a whole number. With legs 5 and 7:

c² = 5² + 7²
c² = 25 + 49
c² = 74
c = √74 ≈ 8.60

A leg

The hypotenuse is 13 and one leg is 5. Start with a² + b² = c² again and put the numbers in their places. The 13 is c, because it lies across from the right angle.

a² + b² = c²
5² + b² = 13²
25 + b² = 169
b² = 169 − 25
b² = 144
b = √144 = 12

Check: 12 is shorter than 13. If you had added by mistake, you would get √194 ≈ 13.93. That is longer than the hypotenuse, so it cannot be right.

In short:

  • To find the hypotenuse, add the squares.
  • To find a leg, subtract the small square from the large one.

Applied: the ladder

A 5 metre ladder leans against a wall. Its foot stands 1.4 metres from the wall. How high does the ladder reach? The ladder is the hypotenuse. The height h is a leg.

h² + 1.4² = 5²
h² + 1.96 = 25
h² = 25 − 1.96
h² = 23.04
h = √23.04 = 4.8

The ladder reaches 4.8 metres high.

Checking for a right angle

The theorem also works the other way round. Take a triangle with sides a, b and c, where c is the longest. If a² + b² = c², the angle across from c is exactly 90°. If not, the triangle has no right angle.

A triangle with sides 5, 12 and 13. The longest side is 13.

5² + 12² = 25 + 144 = 169
13² = 169
169 = 169, so the angle across from 13 is a right angle.

A triangle with sides 6, 7 and 9. The longest side is 9.

6² + 7² = 36 + 49 = 85
9² = 81
85 ≠ 81, so the triangle has no right angle.

It is only 4 off. The angle across from 9 is about 87.3°. By eye it looks like a right angle, but it is not. Pick a triangle below and compare.

Right or not

Pick a triangle

  • Longest side
  • The other two sides
≈ 87.3°976
a² + b²
6² + 7² = 36 + 49 = 85
c²
9² = 81
Angle across from the longest side
≈ 87.3°
Conclusion
a² + b² is more than c², so the angle is acute: less than 90°.
The longest side lies along the bottom. The angle at the top lies across from it. Each triangle is drawn to scale.
Show the numbers
Sidesa² + b²c²Angle
3, 4, 5252590°
5, 12, 1316916990°
8, 15, 1728928990°
6, 7, 98581≈ 87.3°
2, 3, 41316≈ 104.5°

The difference tells you something too:

  • If a² + b² is more than c², the largest angle is acute: less than 90°.
  • If a² + b² is less than c², that angle is obtuse: more than 90°. With 2, 3 and 4, 4 + 9 = 13 is less than 16. The angle is about 104.5°.

Carpenters use this to set out a right angle. They measure 30 cm along one side and 40 cm along the other. If the distance between the two marks is exactly 50 cm, the angle is a right angle. That is because 30² + 40² = 900 + 1600 = 2500 = 50².

The distance between two points

In a coordinate plane you cannot always count the distance between two points along the grid lines. A sloping line cuts right through the cells. You can make a staircase instead: first across, then up. Those two steps and the sloping line form a right triangle.

Take A(−3, −2) and B(1, 1).

across: 1 − (−3) = 4
up: 1 − (−2) = 3
AB² = 4² + 3²
AB² = 16 + 9
AB² = 25
AB = √25 = 5

Drag A and B below. You can also tap the grid. The nearest point then jumps there.

Drag the points
  • Step across and step up
  • Distance AB
−4−4−2−200224443AB
A, B
(−3, −2), (1, 1)
Across
1 − (−3) = 4
Up or down
1 − (−2) = 3
AB
√(4² + 3²) = √25 = 5
The step across and the step up or down form a right triangle with AB.
Show the numbers
Pointxy
A−3−2
B11

As a formula, with A(xA, yA) and B(xB, yB):

AB = √((xB − xA)² + (yB − yA)²)

The order does not matter. A negative step becomes positive once you square it.

One more example: A(−2, 1) and B(4, 9).

xB − xA = 4 − (−2) = 6
yB − yA = 9 − 1 = 8
AB² = 6² + 8²
AB² = 36 + 64
AB² = 100
AB = √100 = 10

In space: the diagonal of a box

A box is 4 long, 3 wide and 12 high. The space diagonal runs from a bottom corner straight through the box to the opposite top corner. You work it out in two steps, using Pythagoras twice.

Step 1: the floor diagonal. The floor is a rectangle of 4 by 3. Its diagonal d is the hypotenuse of a triangle on the floor.

d² = 4² + 3²
d² = 16 + 9
d² = 25
d = √25 = 5

Step 2: the space diagonal. The floor diagonal and an upright edge meet at a right angle. The space diagonal D is the hypotenuse of that standing triangle.

D² = d² + 12²
D² = 25 + 144
D² = 169
D = √169 = 13

Change the length, the width and the height with the sliders.

The diagonal of a box
  • Floor diagonal
  • Space diagonal
4312
Floor diagonal
√(4² + 3²) = √25 = 5
Space diagonal
√(25 + 12²) = √169 = 13
Dotted lines are edges at the back. The small square marks the right angle between the floor diagonal and the upright edge.
Show the numbers
MeasureValue
Length4
Width3
Height12
Floor diagonal√25 = 5
Space diagonal√169 = 13

In step 2 you use d² = 25. So you do not need the square root from step 1. That is why you can also do it in one go:

D = √(length² + width² + height²)
D = √(4² + 3² + 12²)
D = √(16 + 9 + 144)
D = √169 = 13

Does a 60 cm stick fit in a box of 40 by 30 by 30 cm?

d² = 40² + 30²
d² = 1600 + 900
d² = 2500
D² = 2500 + 30²
D² = 2500 + 900
D² = 3400
D = √3400 ≈ 58.3

The longest line inside the box is about 58.3 cm. So the 60 cm stick does not fit.

Try it yourself

A right triangle has a hypotenuse of 17 and a leg of 8. How long is the other leg?

Show the answer

8² + b² = 17², so b² = 289 − 64 = 225. Then b = √225 = 15.

Is a triangle with sides 7, 24 and 25 a right triangle? And one with sides 8, 10 and 12?

Show the answer

7² + 24² = 49 + 576 = 625 and 25² = 625. They are equal, so the first triangle has a right angle. For the second, 8² + 10² = 64 + 100 = 164 and 12² = 144. They are not equal, so that triangle has no right angle. Because 164 is more than 144, its largest angle is acute.

How far apart are P(−1, 5) and Q(4, −7)?

Show the answer

Across: 4 − (−1) = 5. Down: −7 − 5 = −12. Squared: 5² + (−12)² = 25 + 144 = 169. So PQ = √169 = 13.

Read next