News for hackers. Stuff that matters.
Re:Ask HN: How to calculate if a box will fit through a hall... by niyazpk on Thursday May 21, 2009 @06:48AM (#620189)
Consider a box l x b x h

let x = width of one corridor.

let y = width of the perpendicular corridor.

We will disregard the height of the box here since I assume that you can find out the correct way to orient the box.

The box will fit throught the hallway if:

(sqrt(x^2+y^2) - l/2) >= b

I will post the reasoning after I get out of my office.

BTW, thanks for posting this intersting problem.

Re:Ask HN: How to calculate if a box will fit through a hall... by NoBSWebDesign on Thursday May 21, 2009 @01:07PM (#620742)
I really am curious as to how you arrived at this equation. It is a vast over-simplification of the problem.

The equation I came up with is as follows:

y1 = [l/(2b(1/tan(a)^2 - cos(a))] * [x - l/cos(a) + b/sin(a)] + l/cos(a) + b/sin(a)

where you plugin b, l, and x based on your parameters, and find the maximum value for y1 when a goes from 0 to 90 degrees. That maximum value should be less than y for the box to be able to fit around the corner.