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.
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 (front left), (front right), (back right) and (back left). Label the top corners , , and , directly above them. The box's length is , its width is and its height is , all measured in the same unit. The space diagonal you want is .
Two right triangles connect these lengths.
- Triangle lies flat on the bottom face. Its right angle is at , because the bottom face is a rectangle. The side opposite the right angle is called the hypotenuse. Here it is , the base diagonal of the bottom face.
- Triangle stands upright inside the box. Its right angle is at . Edge 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 , including . Its hypotenuse is .
So 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, , holds in a right triangle with legs and and hypotenuse , the side opposite the right angle. For a box, use it twice:
- In triangle , with its right angle at , find the base diagonal from the length and the width .
- In triangle , with its right angle at , find the space diagonal from and the height .
Side lengths are positive, so take the nonnegative square root each time. Keep a square root such as exact until the last step. Do not replace it with a rounded decimal.
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.
Worked example
The box in the figure above is cm long, cm wide and cm tall, so , and . How long is its space diagonal ?
Start with the flat triangle . Its right angle is at , so its hypotenuse is and its legs are and . Substitute them into the theorem and work out each square.
is a side length, so it is positive. The positive number whose square is is . The other square root, , cannot be a length.
Now use the upright triangle . Its right angle is at , so its hypotenuse is . Its legs are the base diagonal and the height .
is also a side length, so take the nonnegative square root.
Check the sizes. In a right triangle, the hypotenuse (the side opposite the right angle) is longer than each leg. Here is longer than and , and is longer than and , so both results are reasonable.
Answer
The space diagonal of this box is cm long.
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.
Worked example
The box in the figure above is inches long, inches wide and inches tall. Find the exact length of its space diagonal .
In triangle the right angle is at , so is the hypotenuse. Substitute the legs and .
No whole number squares to , so write the nonnegative root exactly as . Keep it that way. is exactly , but a rounded value such as squares to . That error would carry into the next step.
In triangle the right angle is at , so is the hypotenuse, with legs and . Squaring gives back exactly .
Take the nonnegative square root, since is a side length.
Answer
The space diagonal is exactly inches long, even though the base diagonal is inches.
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.
Worked example
A thin, straight rod is inches long; treat it as a segment with no thickness. The shipping box in the figure above is inches long, inches wide and inches tall. Can the rod lie flat along the base diagonal ? Can it fit along the space diagonal ?
Triangle has its right angle at , so is its hypotenuse; substitute the legs and . Take the nonnegative root, because is a side length. Since , the rod is too long to lie flat along .
Triangle has its right angle at , so is its hypotenuse; substitute the legs and .
No whole number squares to , so the exact length is the nonnegative root inches. The calculation is finished, so only now should you round. A calculator gives about inches, to the nearest hundredth.
Compare the rod with . The rod's inches is less than about inches. So it fits along the space diagonal with roughly inch to spare.
Answer
The rod is too long to lie flat along the -inch base diagonal. It fits along the space diagonal, which is exactly inches, or about inches, long.
Takeaway: to find a box's space diagonal, use two right triangles that share the base diagonal. First use , with the right angle at . Then use , with the right angle at . 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.