I am working on an Image Processing project and recently faced a situation which when put mathematically looks like:
In the image, the planes AA' and BB' are parallel to each other and subtend an angle theta with the x-axis
A point (p) on the plane AA' is projected onto BB' as (q). At what angle should the plane AA' should be rotated such that when the point (p) is projected onto BB' falls at point (r)? The known parameters are the angle theta, x and y. Or Do I need any additional information to calculate the rotation angle?
Label the new angle between $AA'$ and the horizontal axis after rotation as $\phi$. Drop a parallel from the point of intersection $t$ of the rotated version with the horizontal through $r$, and label its point of intersection with the horizontal line as $u$.
Elementary trigonometry says that the side opposite to $\phi$ in $\triangle Atu$ should have length $y\sin{\theta}-x\sin(\theta)=(y-x)\sin(\theta)$. Relating that to $\phi$, we have $y\sin(\phi)=(y-x)\sin(\theta)$. Solving, you get $\phi=\arcsin(\frac{(y-x)\sin(\theta)}{y})$.
The amount you need to rotate, then, is the difference between $\theta$ and $\phi$.