Equation for Elevation & Azimuth after Rotation in Two Axes

59 Views Asked by At

Ideally I'd like a general equation but I've drawn a specific example of rotating a board $45^\circ$ from horizontal then $45^\circ$ on its own axis. I haven't been able to come up with an equation to describe the resulting angle of the vector normal to the board's surface from horizontal (i.e. the angle of elevation). I also need an equation to describe the resulting angle projected onto the horizontal plane, such as the red axis being $0^\circ$ and green being $90^\circ$ (i.e. angle of azimuth).

Vector normal to surface after rotation around y-axis and around its own axis

2

There are 2 best solutions below

2
On BEST ANSWER

Using the attached picture as a reference, and using the $+x$ axis to be the red solid ray pointing from from the origin to the right of the image (and down), and the $+y$ axis to be the green solid ray pointing from the origin to the right of the image (and up). And finally the $+z$ axis to be the blue solid ray pointing from the origin, upwards to the top of the image. This is a right handed system.

Now assume the axis of rotation as shown in the image is the line passing through the origin and making an angle of $-\phi$ with the $+x$ axis, then the unit vector along this axis of rotation is

$ a = ( \cos \phi , - \sin \phi , 0) $

And we want to rotate the unit vector $k = [0, 0, 1]^T $ about this axis, by an angle $\theta = +\dfrac{\pi}{4}$.

According to the Rodrigues' rotation formula The rotated vector $k'$ is given by

$ k' = k \cos \theta + (1 - \cos \theta) a (a^T k) + (a \times k) \sin \theta $

Therefore, noting that $a^T k = 0$ , this simplifies to

$ k' = [0, 0, 1]^T \cos 45^\circ + [\cos \phi, -\sin \phi, 0]^T \times [0, 0, 1]^T \sin 45^\circ $

Now, $ [\cos \phi, -\sin \phi, 0]^T \times [0, 0, 1]^T = [- \sin \phi , - \cos \phi , 0 ]^T $

Hence,

$ k' = \dfrac{1}{\sqrt{2}} [ - \sin \phi , - \cos \phi , 1 ] $

Now, let $ b = [ \sin \phi , \cos \phi , 0 ] $ be the vector representing the axis of rotation for the second rotation. However this coordinates of $b$ are before the first rotation. After the first rotation, they become (again noting that $b^T a = 0 $)

$ b' = b \cos \theta + (a \times b) \sin \theta $

And this evaluates to

$ b' = \dfrac{1}{\sqrt{2}} [ \sin \phi, \cos \phi, 1]^T $

Now we want to rotate $k'$ about $b'$ by angle of $\theta = +45^\circ$. Using the same formula, we get the final image $k''$ as

$ k'' = k' \cos \theta + b' (b' \cdot k') (1 - \cos \theta) + (b' \times k') \sin \theta $

Noting that $b' \cdot k' = 0 $, this becomes

$ k'' = \dfrac{1}{\sqrt{2}} ( k' + b' \times k' ) $

We have, $b' \times k' = [ \cos \phi, - \sin \phi, 0 ] $

So that

$ k'' = \dfrac{1}{\sqrt{2}} \bigg( \dfrac{1}{\sqrt{2}} [ - \sin \phi , - \cos \phi , 1 ] + [ \cos \phi, - \sin \phi, 0 ] \bigg)$

And in final form,

$ k'' = \dfrac{1}{\sqrt{2}} [ \cos \phi - \dfrac{1}{\sqrt{2}} \sin \phi , - \sin \phi - \dfrac{1}{\sqrt{ 2 }} \cos \phi , \dfrac{1}{\sqrt{2}} ] $

The angle of elevation from the $xy$ plane of the vector $k''$ is just the complement of the angle it makes with $+z$ axis. Using dot product, this is

$ \cos \psi = \dfrac{1}{2} $

Therefore, $\psi = 60^\circ$

And the angle of elevation is the complement of that, which is $30^\circ$.

Projecting $k''$ on the $xy$ plane, and normalizing, gives the vector

$ P = \sqrt{\dfrac{2}{3}} [ \cos \phi - \dfrac{1}{\sqrt{2}} \sin \phi , - \sin \phi - \dfrac{1}{\sqrt{ 2 }} \cos \phi , 0 ] $

If $ \tan \alpha = \dfrac{1}{\sqrt{2}} $, then

$ \cos \alpha = \sqrt{\dfrac{2}{3}}$

Thus,

$ P = \cos \alpha [ \cos \phi - \tan \alpha \sin \phi, - \sin \phi - \tan \alpha \cos \phi, 0 ] $

And this is equal to

$ P = [ \cos( \phi + \alpha ) , - \sin( \phi + \alpha) ,0 ] $

Hence, projected doubly rotated normal vector to the plane makes an angle of

$ \psi = - ( \phi + \alpha) $

with the positive $x$ axis. Note that $\alpha = \tan^{-1} \left(\dfrac{1}{\sqrt{2}}\right) \approx 35.26^\circ $

1
On

Conventions. Let's solve this problem in a standard right-handed coordinate system. The $x$ axis will be the green axis pointing to the right in the image, the $y$ axis points into the visual plane along the red axis, and the $z$-axis will point upwards along the blue axis. (If we want to swap $x$ and $y$ later, the azimuthal angles will be swapped with their complements.)

It's much simpler to describe first rotating by $+45^\circ$ about the $x$-axis (counterclockwise looking down on the $yz$-plane). This is accomplished via the linear transformation: $$ R_x = \begin{pmatrix} 1 & 0 & 0 \\ 0 & \cos 45^\circ & -\sin 45^\circ \\ 0 & \sin 45^\circ & \cos 45^\circ \end{pmatrix} = \begin{pmatrix} 1 & 0 & 0 \\ 0 & 1/\sqrt2 & -1/\sqrt2 \\ 0 & 1/\sqrt2 & 1/\sqrt2 \end{pmatrix}. $$

Then we rotate by $-45^\circ$ about the $y$-axis (clockwise looking down on the $xz$-plane). This is accomplished via the linear transformation: $$ R_y = \begin{pmatrix} \cos 45^\circ & 0 & -\sin 45^\circ \\ 0 & 1 & 0 \\ \sin 45^\circ & 0 & \cos 45^\circ \end{pmatrix} = \begin{pmatrix} 1/\sqrt2 & 0 & -1/\sqrt2 \\ 0 & 1 & 0 \\ 1/\sqrt2 & 0 & 1/\sqrt2 \end{pmatrix}, $$ where we've used the negative angle identities $\cos(-\theta) = \cos\theta$ and $\sin(-\theta) = - \sin\theta$.

Now, the combined transformation is $$ R_yR_x = \begin{pmatrix} 1/\sqrt2 & 0 & -1/\sqrt2 \\ 0 & 1 & 0 \\ 1/\sqrt2 & 0 & 1/\sqrt2 \end{pmatrix} \begin{pmatrix} 1 & 0 & 0 \\ 0 & 1/\sqrt2 & -1/\sqrt2 \\ 0 & 1/\sqrt2 & 1/\sqrt2 \end{pmatrix} = \begin{pmatrix} 1/\sqrt2 & -1/2 & -1/2 \\ 0 & 1/\sqrt2 & -1/\sqrt2 \\ 1/\sqrt2 & 1/2 & 1/2 \end{pmatrix}. $$

The original normal vector is the unit normal in the $+z$ direction, namely $$ \mathbf{n} = \begin{pmatrix} 0 \\ 0 \\ 1 \end{pmatrix}, $$ and after the orthogonal transformation $R_yR_x$ it is $$ R_yR_x\mathbf{n} = \begin{pmatrix} 1/\sqrt2 & -1/2 & -1/2 \\ 0 & 1/\sqrt2 & -1/\sqrt2 \\ 1/\sqrt2 & 1/2 & 1/2 \end{pmatrix} \begin{pmatrix} 0 \\ 0 \\ 1 \end{pmatrix} = \begin{pmatrix} -1/2 \\ -1/\sqrt2 \\ 1/2 \end{pmatrix} $$

Before we find angles, we need to first project this rotated normal vector onto the $xy$-plane: $$ \mathbf{v} = \pi_{yz}R_yR_x\mathbf{n} = \begin{pmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 0 \end{pmatrix} \begin{pmatrix} -1/2 \\ -1/\sqrt2 \\ 1/2 \end{pmatrix} = \begin{pmatrix} -1/2 \\ -1/\sqrt2 \\ 0 \end{pmatrix}. $$

It will be easier if we normalize this vector: $$ \hat{\mathbf{v}} = \frac{\mathbf{v}}{\lvert\mathbf{v}\rvert} = \frac{2}{\sqrt3} \begin{pmatrix} -1/2 \\ -1/\sqrt2 \\ 0 \end{pmatrix} = \frac{2\sqrt3}{3} \begin{pmatrix} -1/2 \\ -\sqrt2/2 \\ 0 \end{pmatrix} = \begin{pmatrix} -\sqrt3/3 \\ -\sqrt6/3 \\ 0 \end{pmatrix} $$ Now, the altitude $\alpha$ (angle with respect to the horizontal) satisfies $$ \cos \alpha = \begin{pmatrix} -1/2 \\ -1/\sqrt2 \\ 1/2 \end{pmatrix} \cdot \begin{pmatrix} -\sqrt3/3 \\ -\sqrt6/3 \\ 0 \end{pmatrix} = \frac{\sqrt3}{2} \quad\implies\quad \alpha = 30^\circ. $$

The azimuth $\gamma$ (angle with respect to the positive $x$-axis) satisfies $$ \cos\gamma = \begin{pmatrix} -\sqrt3/3 \\ -\sqrt6/3 \\ 0 \end{pmatrix} \cdot \begin{pmatrix} 1 \\ 0 \\ 0 \end{pmatrix} = -\frac{\sqrt3}{3}. $$

Since we can see that the $y$-component of $\mathbf{v}$ is negative, $$ \gamma = -\arccos\Bigl(-\tfrac{\sqrt3}{3}\Bigr) \approx -125.264^\circ. $$

In your original coordinates, this azimuth is $$ 90^\circ - \gamma \approx 215.264^\circ, $$ which is $35.264^\circ$ West of South if the red axis is North and the green axis is East.