fitting rectangle inside another rectangle in diagonal
Having the following case, where we want to fit a rectangle (c,d) inside another rectangle (a,b). We know that c>b or d>a so it will not fit horizontally, so we need to check if it will fit diagonally. Example: What would be the condition to check if the rectangle (c,d) will fit (a,b) or not.
Thank you in advance,
Let $l=\sqrt{c^2+d^2}$ be the diagonal of the internal rectangle and $\phi=\sin^{-1}\frac{c}{l}=\sin^{-1}\frac{d}{l}$ the angle between the diagonal and a side. Let $\alpha$ be the angle between $a$ and $c$. Then the necessary and sufficient conditions for the internal rectangle to be inside the external one are $$\begin{align} a & \ge l\sin(\alpha+\phi) \\ b & \ge l\cos(\alpha-\phi) \end{align}$$ Assume that $a<l$ and $b<l$ - otherwise the corresponding condition disappears and the problem is thus simplified. The system of inequalities has a solution in $\alpha$ when $$ \sin^{-1}\frac{a}{l} - \phi \ge \cos^{-1}\frac{b}{l} + \phi $$ which is the condition you are looking for.
Let $2a\geq2b$ and $2c\geq2d$ be the sidelengths of the two rectangles, and put $f:=\sqrt{c^2+d^2}$.
When $R_{cd}\subset R_{ab}$ can be realized then it can be done with common center $M$.
A necessary condition for such an inclusion is $d\leq b$, because otherwise $R_{cd}$ contains a disk of radius $d>b$, which cannot be covered by $R_{ab}$. If $c\leq a$ as well then $R_{cd}$ can be embedded in $R_{ab}$ with aligned sides.
Therefore it remains to consider the case $c>a\geq b\geq d$ which is shown in the following figure.
The short sides of $R_{cd}\subset R_{ab}$ are tangent to the circle (shown in blue) with radius $c>a$ and center $M$. This circle intersects $R_{ab}$ in four arcs cutting off the vertices of $R_{ab}$. It follows that the two shorter sides of $R_{cd}$ lie in two opposite corner regions of $R_{ab}$. Consider such a side. Its endpoints lie on a similar arc of a circle with radius $f$ and center $M$. Therefore the length $2d$ of this side is at most equal to the distance $|PQ|$ in the figure. This means that we have $$(2d)^2\leq \left(b-\sqrt{f^2-a^2}\right)^2+\left(a-\sqrt{f^2-b^2}\right)^2\ .$$ Expressing $f$ in terms of $c$ and $d$, and simplifying, you obtain the condition you were looking for.