Find the Rotation of a Rectangle that Produces a Defined Horizontal Projection Size

geometrytrigonometry

A visualization of the problem

Given a desired projection width of x, and a rectangle with a width of B and a length of A, find an angle of rotation $\theta$ (applied with an axis on one of the rectangle's vertices) that will produce the target projection width.

I've gotten this problem down to the trigonometric relationship '$x=Asin\theta + Bcos\theta$' but I have not found a way to isolate $\theta$.

Best Answer

Edit. To answer your question, referring to the picture you posted, introduce a couple more angles. Let $\varphi$ be the angle between the diagonal of the rectangle and side $B$, and let $\psi$ be the angle between the diagonal and the horizontal, so $\psi=\theta-\varphi$, where $\theta$ is the angle between side $B$ and the horizontal. Then $x=\sqrt{A^2+B^2}\cos\psi$, and $\frac A B=\tan\varphi$, so $\theta=\psi+\varphi=\arccos\frac{x}{\sqrt{A^2+B^2}}+\arctan\frac A B$.

Picture with two extra angles <span class=$\varphi$ and $\psi$">

This following answer (which I posted originally, and which could be ignored now) finds the maximal possible width of $x$ (and respective $\theta$), which I just realized does not answer the question as stated: Given arbitrary width $x$ find respective $\theta$.

You could think of $x$ as a function of $\theta$, and take derivative of $x$ to find critical numbers. $x'=A\cos\theta-B\sin\theta=0$, solve for $\theta$. You get $\tan\theta=\frac A B$, so $\theta=\arctan \frac A B$. Then $x=A\sin(\arctan \frac A B)+B\cos(\arctan \frac A B)$, which could be simplified further using a right triangle. This right triangle will have side opposite to $\theta$ of length $A$, adjacent side of length $B$, and hypothenuse of length $\sqrt{A^2+B^2}$. So, $x=A\sin(\arctan \frac A B)+B\cos(\arctan \frac A B)= A\sin\theta+B\cos\theta = \frac{A^2+B^2}{\sqrt{A^2+B^2}}=\sqrt{A^2+B^2}$

Here is a more elementary and clearer solution (for the maximal width), without the use of differentiation. From the picture it is clear that the maximal width equals the length of the diagonal of the given rectangle, and occurs when the diagonal is parallel to the line onto which we project. So maximal width equals $\sqrt{A^2+B^2}$.

So the question that I just did not answer: Given $0<x<\sqrt{A^2+B^2}$ how do we find the respective $\theta$?