Maximum Angle of Rotation of without Clipping of Rectangle

geometryrectanglesrotationstransformationtrigonometry

Given a rectangle $A$ of width $a_x$ and height $a_y$ and a rectangle $B$ of width $b_x$ and height $b_y$ with the same center as $A$, with $b_x>a_x$ and $b_y>a_y$, calculate the maximum positive angle $\alpha$ at which rectangle $B$ can be rotated without any part of it clipping $A$ (meaning that the sides of $B$ never cross the sides of $A$. If $B$ is large enough, then just leave $\alpha=360$ degrees since it can be fully rotated without ever clipping.

Here are some images clarifying what I mean:

Maximum angle example:

enter image description here

Clipping example:

enter image description here

Best Answer

The following figure depicts the "original" arrangement when both rectangles are placed in the same coordinate system (red) with their centers in the origin:

enter image description here

Turn, about it center, the blue triangle counterclockwise until its upper-right corner meets the bigger rectangle. The angle at which this takes place is the same angle by which we would have turned the white rectangle clockwise to hit the blue rectangle.

Take the red circle centered at the origin and calculate its radius: $r=\frac12\sqrt{a_x^2+a_y^2}.$ So, the equation of the red circle is $$x^2+y^2=\frac14\left(a_x^2+a_y^2 \right).$$

Where does this circle hits the straight $y=y_b$? Now, you have two points: the upper right corner of the blue rectangle and the crossing point mentioned above. Can you calculate the angle between the two red lines?