News for hackers. Stuff that matters.
Re:Ask HN: How to calculate if a box will fit through a hall... by tocomment on Thursday May 21, 2009 @07:34AM (#620236)
Thanks for all the answers. It's starting to make sense. I'm relieved to see it's not an easy problem.

If it helps, it's an elliptical machine I was thinking of buying (I was using a rectangular box shape as an abstraction.)

I'm not sure how easily it can be disassembled.

The dimensions are 22" x 57" x 66" and the hallway is 31" in the first corridor and 32" in the next, with a height of 82".

Re:Ask HN: How to calculate if a box will fit through a hall... by niyazpk on Thursday May 21, 2009 @11:42AM (#620608)
According to the condition I previously provided, (sqrt(x^2+y^2) - l/2) should be greater than or equal to b for the box to fit through.

Here let us take h=66 since it will fit only that way in the corridor.

x = 31, y = 32

b = 22, l = 57, h =66

So (sqrt(x^2+y^2) - l/2) = 44.55 - 28.5 = 16.05

Now 16.05 is less than b(=22), so the box will not fit through.

Re:Ask HN: How to calculate if a box will fit through a hall... by NoBSWebDesign on Thursday May 21, 2009 @11:08AM (#620548)
Yeah, this is one of those edge cases where it doesn't satisfy the string test from above, but there is still a chance it could fit.

sqrt[ (57/2)^2 + 22^2 ] = 36", which is greater than 31"