Fitting a painting through a door Deceptively tricky - will it fit through the door?
I work in an art gallery and we regularly take delivery of large paintings housed in wooden crates. Our old building has a door measuring 180 x 234 cm (290 cm diagonal).
What is the formula for calculating whether a painting will fit through our doors diagonally?
For example, I am trying to calculate if we can receive a painting in a crate sized 281 x 347 x 23 cm. Its shortest side (281 cm) is within our diagonal dimension but I estimate that the 23 cm depth means that it will not fit. What is the formula for establishing this accurately?
Ideally I would like to refer to a formula each time I find out the dimensions of a wooden crate.
Door and Crate

Let's say you have a door with sides $2a<2b$ and a painting with smaller dimensions $2\alpha<2\beta$. Of course, if $\alpha<a$ and $\beta<b$, the case is trivial, so I'll assume otherwise. The diagonal of the painting is $2d=2\sqrt{\alpha^2+\beta^2}$ and the smaller angle between those diagonals is $\varphi=2\tan^{-1}(\alpha/\beta)$. We can center the painting in the center of the door since you will remain inside the door by moving the center of the painting through to the point opposite the center of the door.

We need to make sure all four corners lie inside the door. Pick two adjacent corners. If these two corners fit, all four will fit. Orient the picture as above with $\theta$ the angle from the horizontal to the first corner. Then, $\varphi$ is the additional angle to reach the next corner.
The inequalities we need to solve are
$$d\cos\theta<a$$
$$d\sin(\theta+\varphi)<b$$
We assume the painting cannot fit at all angles, so we can find an angle where one of these conditions is equality. Thus, we have two cases
(I) $d\cos\theta = a$ so we use $sin(x+y)=\sin x\cos y+\sin y\cos x$ then ask if the following is true
$$\sqrt{d^2-a^2}\cos\varphi+a\sin\varphi<b$$
(II) $d\sin(\theta+\varphi)=b$ so we use $cos(x-y)=\cos x\cos y+\sin x\sin y$ ask if the following is true
$$\sqrt{d^2-b^2}\cos\varphi+b\sin\varphi<a$$
In your case, paintings are generally thinner than doors, so we opt for (II). In terms of dimensions, this becomes
$$\sqrt{\beta^2-p^2}+\sqrt{b^2-p^2}<a$$
where
$$p^2=\frac{b^2\beta^2}{\alpha^2+\beta^2}$$
Notice, it checks out for $\alpha=0$.
