Chapter 12 · The Pythagorean theorem

Space Diagonals: The Pythagorean Theorem in 3D

Use the Pythagorean theorem twice to find the diagonal through the inside of a box: first across the bottom face, then up through the box.

12 min read

A box in this lesson is a rectangular prism: a solid whose six faces are all rectangles, like a shipping carton. Two corners are opposite when they do not lie on any common face. A segment joining two opposite corners passes through the inside of the box and is called a space diagonal.

A space diagonal does not lie on any face, so no flat triangle drawn on a face contains it. Its length still matters. For example, it tells you whether a long, thin rod can fit in the box from one corner to the opposite corner. In this lesson you find that length by using the Pythagorean theorem twice.

Label the bottom corners AA (front left), BB (front right), CC (back right) and DD (back left). Label the top corners EE, FF, GG and HH, directly above them. The box's length is ABAB, its width is BCBC and its height is CGCG, all measured in the same unit. The space diagonal you want is AGAG.

Two right triangles connect these lengths.

  • Triangle ABCABC lies flat on the bottom face. Its right angle is at BB, because the bottom face is a rectangle. The side opposite the right angle is called the hypotenuse. Here it is ACAC, the base diagonal of the bottom face.
  • Triangle ACGACG stands upright inside the box. Its right angle is at CC. Edge CGCG rises straight up from the bottom face, so it is perpendicular to (at a right angle with) every segment on the bottom face that starts at CC, including ACAC. Its hypotenuse is AGAG.

So ACAC does two jobs. It is the hypotenuse of the flat triangle. It is also a leg (a side that forms the right angle) of the upright one.

Key concept

The space diagonal in two right-triangle steps

The Pythagorean theorem, a2+b2=c2a^2 + b^2 = c^2, holds in a right triangle with legs aa and bb and hypotenuse cc, the side opposite the right angle. For a box, use it twice:

  1. In triangle ABCABC, with its right angle at BB, find the base diagonal ACAC from the length ABAB and the width BCBC.
  2. In triangle ACGACG, with its right angle at CC, find the space diagonal AGAG from ACAC and the height CGCG.

Side lengths are positive, so take the nonnegative square root each time. Keep a square root such as 13\sqrt{13} exact until the last step. Do not replace it with a rounded decimal.

AC2=AB2+BC2AG2=AC2+CG2AC^2 = AB^2 + BC^2 \qquad AG^2 = AC^2 + CG^2
ABCDEFGH12 cm9 cm8 cm

A rectangular box A B C D E F G H, with bottom face A B C D and top face E F G H, hidden edges dashed. It is 12 centimeters long, edge A B, 9 centimeters wide, edge B C, and 8 centimeters high, edge C G. Triangle A B C lies on the bottom face with a right angle at B, so the base diagonal A C squared is 12 squared plus 9 squared, 225, and A C is 15 centimeters. Triangle A C G stands upright with a right angle at C, between the base diagonal A C and the vertical edge C G, so the space diagonal A G squared is 225 plus 8 squared, 289, and A G is 17 centimeters.

This box has AB=12AB = 12 cm, BC=9BC = 9 cm and CG=8CG = 8 cm, and the right-angle marks at BB and CC show the two triangles used in the example below.

Worked example

The box in the figure above is 1212 cm long, 99 cm wide and 88 cm tall, so AB=12AB = 12, BC=9BC = 9 and CG=8CG = 8. How long is its space diagonal AGAG?

  1. Start with the flat triangle ABCABC. Its right angle is at BB, so its hypotenuse is ACAC and its legs are AB=12AB = 12 and BC=9BC = 9. Substitute them into the theorem and work out each square.

    AC2=AB2+BC2=122+92=144+81=225AC^2 = AB^2 + BC^2 = 12^2 + 9^2 = 144 + 81 = 225
  2. ACAC is a side length, so it is positive. The positive number whose square is 225225 is 1515. The other square root, −15-15, cannot be a length.

    AC=225=15 cmAC = \sqrt{225} = 15 \text{ cm}
  3. Now use the upright triangle ACGACG. Its right angle is at CC, so its hypotenuse is AGAG. Its legs are the base diagonal AC=15AC = 15 and the height CG=8CG = 8.

    AG2=AC2+CG2=152+82=225+64=289AG^2 = AC^2 + CG^2 = 15^2 + 8^2 = 225 + 64 = 289
  4. AGAG is also a side length, so take the nonnegative square root.

    AG=289=17 cmAG = \sqrt{289} = 17 \text{ cm}
  5. Check the sizes. In a right triangle, the hypotenuse (the side opposite the right angle) is longer than each leg. Here 1515 is longer than 1212 and 99, and 1717 is longer than 1515 and 88, so both results are reasonable.

Answer

The space diagonal AGAG of this box is 1717 cm long.

ABCDEFGH3 in2 in6 in

A rectangular box A B C D E F G H, with bottom face A B C D and top face E F G H, hidden edges dashed. It is 3 inches long, edge A B, 2 inches wide, edge B C, and 6 inches high, edge C G. Triangle A B C lies on the bottom face with a right angle at B, so the base diagonal A C squared is 3 squared plus 2 squared, 13, and A C is the square root of 13 inches. Triangle A C G stands upright with a right angle at C, between the base diagonal A C and the vertical edge C G, so the space diagonal A G squared is 13 plus 6 squared, 49, and A G is 7 inches.

Here AB=3AB = 3 inches, BC=2BC = 2 inches and CG=6CG = 6 inches, so the base diagonal ACAC is not a whole number, but AGAG turns out to be one.

Worked example

The box in the figure above is 33 inches long, 22 inches wide and 66 inches tall. Find the exact length of its space diagonal AGAG.

  1. In triangle ABCABC the right angle is at BB, so ACAC is the hypotenuse. Substitute the legs AB=3AB = 3 and BC=2BC = 2.

    AC2=AB2+BC2=32+22=9+4=13AC^2 = AB^2 + BC^2 = 3^2 + 2^2 = 9 + 4 = 13
  2. No whole number squares to 1313, so write the nonnegative root exactly as 13\sqrt{13}. Keep it that way. (13)2(\sqrt{13})^2 is exactly 1313, but a rounded value such as 3.63.6 squares to 12.9612.96. That error would carry into the next step.

    AC=13 inAC = \sqrt{13} \text{ in}
  3. In triangle ACGACG the right angle is at CC, so AGAG is the hypotenuse, with legs AC=13AC = \sqrt{13} and CG=6CG = 6. Squaring 13\sqrt{13} gives back exactly 1313.

    AG2=AC2+CG2=(13)2+62=13+36=49AG^2 = AC^2 + CG^2 = (\sqrt{13})^2 + 6^2 = 13 + 36 = 49
  4. Take the nonnegative square root, since AGAG is a side length.

    AG=49=7 inAG = \sqrt{49} = 7 \text{ in}

Answer

The space diagonal AGAG is exactly 77 inches long, even though the base diagonal ACAC is 13\sqrt{13} inches.

ABCDEFGH16 in12 in10 in

A rectangular box A B C D E F G H, with bottom face A B C D and top face E F G H, hidden edges dashed. It is 16 inches long, edge A B, 12 inches wide, edge B C, and 10 inches high, edge C G. Triangle A B C lies on the bottom face with a right angle at B, so the base diagonal A C squared is 16 squared plus 12 squared, 400, and A C is 20 inches. Triangle A C G stands upright with a right angle at C, between the base diagonal A C and the vertical edge C G, so the space diagonal A G squared is 400 plus 10 squared, 500, and A G is the square root of 500 inches.

The shipping box in the next problem has AB=16AB = 16 inches, BC=12BC = 12 inches and CG=10CG = 10 inches, and a rod from corner AA to corner GG would lie along the space diagonal.

Worked example

A thin, straight rod is 2222 inches long; treat it as a segment with no thickness. The shipping box in the figure above is 1616 inches long, 1212 inches wide and 1010 inches tall. Can the rod lie flat along the base diagonal ACAC? Can it fit along the space diagonal AGAG?

  1. Triangle ABCABC has its right angle at BB, so ACAC is its hypotenuse; substitute the legs 1616 and 1212. Take the nonnegative root, because ACAC is a side length. Since 20<2220 < 22, the rod is too long to lie flat along ACAC.

    AC2=162+122=256+144=400,AC=400=20 inAC^2 = 16^2 + 12^2 = 256 + 144 = 400, \quad AC = \sqrt{400} = 20 \text{ in}
  2. Triangle ACGACG has its right angle at CC, so AGAG is its hypotenuse; substitute the legs AC=20AC = 20 and CG=10CG = 10.

    AG2=AC2+CG2=202+102=400+100=500AG^2 = AC^2 + CG^2 = 20^2 + 10^2 = 400 + 100 = 500
  3. No whole number squares to 500500, so the exact length is the nonnegative root 500\sqrt{500} inches. The calculation is finished, so only now should you round. A calculator gives about 22.3622.36 inches, to the nearest hundredth.

    AG=500≈22.36 inAG = \sqrt{500} \approx 22.36 \text{ in}
  4. Compare the rod with AGAG. The rod's 2222 inches is less than about 22.3622.36 inches. So it fits along the space diagonal with roughly 0.360.36 inch to spare.

    22<22.3622 < 22.36

Answer

The rod is too long to lie flat along the 2020-inch base diagonal. It fits along the space diagonal, which is exactly 500\sqrt{500} inches, or about 22.3622.36 inches, long.

Takeaway: to find a box's space diagonal, use two right triangles that share the base diagonal. First use AC2=AB2+BC2AC^2 = AB^2 + BC^2, with the right angle at BB. Then use AG2=AC2+CG2AG^2 = AC^2 + CG^2, with the right angle at CC. In each triangle the hypotenuse is the side opposite the right angle, and each length is the nonnegative square root. Keep square roots exact until the final step.