# Minimum distance to reach opposite corner

An ant is caught on one corner of a cuboid with sides $l, b,$ and $h$. It wants to reach the diagonally opposite corner, However, the ant can perform a walk only along the faces of the cuboid. What is the least amount of distance that the ant needs to walk to reach the other corner?

Example : Let $l=b=h=4$ then answer is $8.944271$. How to find it for given $l , b$ and $h$ ?

If we look at the net of the box:

The ant starts at the blue/pink/green corner. He would like to get to the red/orange/grey corner.

My box is a cube; assume each side has length $l$. $2l$ is the combined width of the orange and pink faces. Using Pythag, where $d$ is the distance the ant must travel:

$$d^2 = l^2 + (2 l)^2\\ d^2 = 5l^2\\ d = l\sqrt5$$

Of course, for a cuboid where $l \neq b \neq h$, the values would be different. However the math would be largely the same. Assume the pink square now has dimensions $l \times h$; the orange $b \times h$.

$$d^2 = (l + b)^2 + (h)^2\\ d^2 = l^2 + 2bh + b^2 + h^2\\ d = \sqrt{l^2 + b^2 + h^2 + 2bh}$$

Note that for the cubic case, where $l=b=h$, the above simplifies into my original result.

• Had you made any assumption that l>=b>=h or something of there order ? Commented Mar 14, 2015 at 19:39
• There is no need for those assumptions. We may always open a box into a net, regardless of what you define to be l, b, or h.
– baum
Commented Mar 14, 2015 at 19:41
• Why it cant be (l+h)^2 + b^2 ? Commented Mar 14, 2015 at 19:43
• It could very well be. That is my point. It could be a, b, and c if you wanted to do. The variables are just symbols with no intrinsically mathematical values.
– baum
Commented Mar 14, 2015 at 19:44
• @baum, Shouldn't the middle expanded term be $2lb$ instead of $2bh$? Commented Jul 31, 2019 at 20:45

Hint: Suppose you enclose perfectly the cake inside a box. Open it as a net.

• Where are starting and ending points of the original cuboid on the net?
• What is the distance?
• If it start from some point then it must reach diagonally opposite corner walking along the faces. And distance is obviously the euclidean distance Commented Mar 14, 2015 at 18:07
• Please elaborate hint. As it give no clue..:( Commented Mar 14, 2015 at 18:09
• In this answer i give you only a hint. Look at the picture and think about these two points in order. I hope the answer should be straightforward.
– Blex
Commented Mar 14, 2015 at 18:14
• Still no help ..:( Commented Mar 14, 2015 at 18:17
• On the net, draw a diagonal line from the ant's position to the opposite corner.
– baum
Commented Mar 14, 2015 at 18:24