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$ ?


2 Answers 2


If we look at the net of the box:

enter image description here

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.

  • $\begingroup$ Had you made any assumption that l>=b>=h or something of there order ? $\endgroup$
    – doremoon
    Commented Mar 14, 2015 at 19:39
  • $\begingroup$ 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. $\endgroup$
    – baum
    Commented Mar 14, 2015 at 19:41
  • $\begingroup$ Why it cant be (l+h)^2 + b^2 ? $\endgroup$
    – doremoon
    Commented Mar 14, 2015 at 19:43
  • $\begingroup$ 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. $\endgroup$
    – baum
    Commented Mar 14, 2015 at 19:44
  • $\begingroup$ @baum, Shouldn't the middle expanded term be $2lb$ instead of $2bh$? $\endgroup$ 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?
  • $\begingroup$ If it start from some point then it must reach diagonally opposite corner walking along the faces. And distance is obviously the euclidean distance $\endgroup$
    – doremoon
    Commented Mar 14, 2015 at 18:07
  • $\begingroup$ Please elaborate hint. As it give no clue..:( $\endgroup$
    – doremoon
    Commented Mar 14, 2015 at 18:09
  • $\begingroup$ 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. $\endgroup$
    – Blex
    Commented Mar 14, 2015 at 18:14
  • $\begingroup$ Still no help ..:( $\endgroup$
    – doremoon
    Commented Mar 14, 2015 at 18:17
  • $\begingroup$ On the net, draw a diagonal line from the ant's position to the opposite corner. $\endgroup$
    – baum
    Commented Mar 14, 2015 at 18:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .