# Angle between two non-coplanar vectors

I have two vectors ($\vec{a}$ and $\vec{b}$) from which I don't know their components. I do know the angle they form with one of the axis, let us say $Z$ ($\alpha$ and $\beta$ respectively) and the angle they form in the perpendicular plane $XY$ ($\phi$).

How does one find the angle between $\vec{a}$ and $\vec{b}$?

So far, I've tried using the dot product, but as I don't know the vectors, I can't calculate that value.

The further I have gone has been by taking the dot product and the cross product of the projections of the vectors $\vec{a}$ and $\vec{b}$ in the $XY$ plane and equating the modulus, but I'm not even sure that this is a good approach.

• "The angle they form in the perpendicular plane XY": what does that mean ? I don't think your vectors belong to that plane. – Yves Daoust Apr 26 '18 at 15:45
• Plane perpendicular to the axis Z. Which is the axis which we know the angles the vectors form. – Noxbru Apr 26 '18 at 16:06
• Please read my comment thoroughly. – Yves Daoust Apr 26 '18 at 16:06
• This is a classic spherical triangle problem given two sides and the included angle. Think of two points on the earth surface with latitudes and difference in longitudes. – Somos Apr 26 '18 at 17:50

$$\begin{cases} a=|a|(\sin\alpha\cos\phi_a,\sin\alpha\sin\phi_a,\cos\alpha)\\ b=|b|(\sin\beta\cos\phi_b,\sin\beta\sin\phi_b,\cos\beta) \end{cases}\\ \Rightarrow \cos\theta=\frac{a\cdot b}{|a||b|}=\sin\alpha\sin\beta\cos(\phi_a-\phi_b)+\cos\alpha\cos\beta.$$
• @YvesDaoust This is $\phi_a-\phi_b$. – user Apr 26 '18 at 16:07