# Maximum length of a pipe through a hall way in three dimensions with a 90 degree turn

I have found similar answers to this question in two dimensions but I am having trouble figuring out how to convert this into three dimensions taking into account the height. The question is as follows:

Two hallways, 10 ft wide and 16 ft wide respectively, open into each other at right angles. The ceiling is 12 ft high. Determine the maximum length a pole can have to be transferred from one end to the other.

Upon researching I have found a formula for the length in two dimensions being: $L=(A^{2/3}+B^{2/3})^{3/2}$ such that A and B represent the width of the two hall ways. However, I am unaware how to take into account the ceiling still and would like to understand the concept behind this. Important to note this is a calculus 3 class.

Let $\ell$ be the length of the pole, and let $C$ be the height of the hallways. We should let the pole touch the floor and the ceiling at all times. The vertically projected length $\ell'$ of the pole will then be given by $\ell'=\sqrt{\ell^2-C^2}$ at all times. This projected length has to be $\leq L$, or the pole cannot be moved around the corner. The resulting condition therefore is $$\ell^2\leq C^2+\bigl(A^{2/3}+B^{2/3}\bigr)^3\ .$$