Angle between horizontal projections of two vectors. I have a tricky question and don't know if you can solve this one:
Given:


*

*I have a vector $\vec{A}$. 

*I have the angle between vector $\vec{B}$ and the projection of $\vec{B}$ on the $xz$-plane.

*I know that $\vec{B}$ is perpendicular to $\vec{A}$.

*I know the length of $\vec{B}$ is $1$.



How to calculate the angle between the projection of $\vec{A}$ and the projection of $\vec{B}$ in the $xz$-plane, in function of the angle between $\vec{A}$ and the $xz$-plane?

I'm curious if someone can give a decent answer, succes !
 A: I'm going to slightly change the problem:  rather than have the angles & projections relative to the $xz$-plane, I'm going to do them relative to the $xy$-plane.  This is really just a relabeling of the axes, but it allows us to use spherical polar coordinates for the vectors.  In particular, we have
$$
\vec{A} = |\vec{A}|  \left[ (\sin \phi_A \cos \theta_A) \hat{x} +  (\sin \phi_A \sin \theta_A) \hat{y} + (\cos \phi_A) \hat{z} \right]
$$ $$
\vec{B} = (\sin \phi_B \cos \theta_B) \hat{x} +  (\sin \phi_B \sin \theta_B) \hat{y} + (\cos \phi_B) \hat{z}
$$
(note that $|\vec{B}| = 1$.)  The angle between $\vec{A}$ and its projection on the $xy$-plane is then $\alpha_A = \frac{\pi}{2} - \phi_A$, and the angle between $\vec{B}$ and its projection is $\alpha_B = \frac{\pi}{2} - \phi_B$.  WLOG we can choose the projection of $\vec{B}$ into the $xy$-plane to lie on the $x$-axis;  this means that $\theta_B = 0$, and $\theta_A$ will be the angle between the vectors' projections into the $xy$-plane.  Thus, our vectors are now
$$
\vec{A} = |\vec{A}|  \left[ (\cos \alpha_A \cos \theta_A) \hat{x} +  (\cos \alpha_A \sin \theta_A) \hat{y} + (\sin \alpha_A) \hat{z} \right]
$$ $$
\vec{B} = (\cos \alpha_B) \hat{x} + (\sin \alpha_B) \hat{z}
$$
We also know that $\vec{A}$ and $\vec{B}$ are perpendicular, so we must have
$$
0 = \vec{A} \cdot \vec{B} = |\vec{A}| \left[ \cos \alpha_A \cos \theta_A \cos \alpha_B + \sin \alpha_A \sin \alpha_B \right]
$$
which then implies that
$$
\boxed{ \cos \theta_A = - \frac{ \sin \alpha_A \sin \alpha_B }{ \cos \alpha_A \cos \alpha_B} = - \tan \alpha_A \tan \alpha_B.}
$$
Note that the right-hand side of this equation will not always be between -1 and 1 for certain values of $\alpha_A$ and $\alpha_B$.  This is because the angles $\alpha_A$ and $\alpha_B$ cannot be freely specified and still satisfy all of above constraints, particularly the orthogonality constraint.  For example, if $\alpha_A = \alpha_B = 75°$, then the angle between them cannot be greater than $30°$, and the orthogonality constraint cannot be satisfied.
