Pythagoras in 3D

The longest diagonal of a box

A cuboid (a box) has a longest diagonal that runs from one corner straight through the inside to the opposite corner. To find its length we apply Pythagoras twice.

First, look at the rectangular base, with sides a and b. Its diagonal d is the hypotenuse of a right triangle:

d^2 = a^2 + b^2

Now stand the height c up from the end of that base diagonal. The base diagonal d and the height c form a second right triangle, whose hypotenuse is the space diagonal D:

D^2 = d^2 + c^2 = a^2 + b^2 + c^2

So the longest diagonal of an a \times b \times c cuboid is

D = \sqrt{a^2 + b^2 + c^2}

One idea, two right triangles

Picture the two diagonals

Step through the sketch: the box, then the base diagonal d, then the space diagonal D running from a bottom corner to the opposite top corner.