[Math] Change in angle due to rotation in another plane

geometry

I hope someone can help me figure this out.

Step 1: We are looking at the ZX plane (front view). I have two lines, which have been rotated 15 degrees around the Y axis. At this step both lines are identical (except for the colour).
Step 1

Step 2: We are now looking at the XY plane (top view). I take the yellow line and rotate it 60 degrees around the Z Axis.
Step 2

Step 3: We are back at our starting view (ZX plane – front). The angle of the yellow line and the X-Axis is 28.18679 degrees. How can this angle be calculated?

** EDIT **
I used a CAD program to draw this, and I also used the CAD program to measure the angle. I need to calculate the angle programatically though.

Step 3

Thanks a million!

Best Answer

The direction vector of the yellow line is

$$ \pmatrix{\cos\theta\cos\phi\\\cos\theta\sin\phi\\\sin\theta} $$

with $\theta=15^\circ$ and $\phi=60^\circ$. Thus its angle with the $x$ axis is

$$ \arccos\left(\cos\theta\cos\phi\right)=\arccos\left(\cos15^\circ\cos60^\circ\right)\approx61.1^\circ\;. $$

Since this is far from your measurement of $\approx28.2^\circ$, it seems that what you're interested in may in fact not be the angle of the yellow line with the $x$ axis. The image suggests that the angle you're measuring is the angle between the $x$ axis and the projection of the yellow line onto the $x$-$z$ plane. This is indeed

$$ \arctan\frac{\sin\theta}{\cos\theta\cos\phi}=\arctan\frac{\sin15^\circ}{\cos15^\circ\cos60^\circ}\approx28.18679^\circ\;. $$

Related Question