Fitting a piece of furniture through a corridor
(The following is a partial answer at best, but too long for a comment.)
Suppose $\,a \le b\,$, otherwise flip the corridor around. If the box gets fully in through door $\,a\,$, then it will be able to get out through $\,b\,$ by symmetry, so it's enough to consider the move through $\,a\,$.
First step is to slide the box in at the maximum possible angle $\alpha$. If it can not get in the position depicted below without hitting the opposite walls first, then the move is impossible.
The angle $\alpha$ is determined by:
- $\,a \cos \alpha = h'\,$
Then the conditions for the inside corners of the box to fit are:
$w' \cos \alpha \le w$
$w' \sin \alpha + h' \cos \alpha \le h$
(As a side comment, the first condition is equivalent to $\,h' \cdot w' \le a \cdot w\,$ i.e. the area of the box no larger than the area from the door to the opposite wall.)
These are necessary conditions, and no solution is possible if they don't hold. They are not sufficient conditions in general, though.
The next step would be to rotate the box towards vertical position by sliding the bottom corner to the right while keeping the top side in contact with the door edge. Such rotation, however, requires additional room at the top, and possibly to the right as well. Exactly how much room reduces in the end to finding the extrema of some trig functions, to which I did not find "nice" closed solutions.
Still, there are a couple of cases where the above conditions are sufficient as well (both of which assume that the length of the corridor is larger than the diagonal of the box $\,h \ge \sqrt{w'^2+h'^2}\,$).
If there is no perpendicular wall right next to $\,a\,$ i.e. if the bottom horizontal line in the drawing is missing, then the rotation can always be completed by sliding the bottom corner down and to the right, such that the box stays in contact with both edges of the door. In this case, the rightmost corner of the box never moves any closer to the right wall than it was before, so the previous condition is sufficient.
If the horizontal'ish diagonal of the red box has an upwards slope in that position (unlike the slightly downwards one in the picture), then again the rotation can be completed without requiring additional room on the right. This is the case when $\,\varphi \ge \frac{\pi}{2} - \alpha\,$ where $\,\varphi\,$ is the angle between the diagonal of the box and its wide side, which translates to $\,a \ge \frac{h'}{\sin \varphi}=\frac{h' \sqrt{h'^2+w'^2}}{w'}\,$.
(The above leaves out some trivial cases such as $w'\le w$ when the box can be simply translated all the way, or $w' \le a, h' \le w$ when the box can be first turned sideways then translated, but in my practice of having moved large boxes around corners those cases never happen ;-))