Geometry – Finding the Unit Direction Vector Given Azimuth and Elevation

geometryspherical coordinatestrigonometry

I want to calculate a unit direction vector of a direction with given the azimuth and elevation (cf. http://en.wikipedia.org/wiki/Azimuth), respectively
$$\alpha \in [0^{\circ},360^{\circ}), \qquad \beta \in (-90^{\circ},90^{\circ}).$$
I have a right-handed coordinate system with z-up and looking down +y (yes, I have a graphics background :D). I got the hint that it's easy to calculate using trigonometry, but I don't really understand the solution:

$$
\begin{pmatrix}x\\y\\z\end{pmatrix} = \begin{pmatrix}\sin(\alpha) \cos(\beta)\\ \cos(\alpha)\cos(\beta)\\ \sin(\beta)\end{pmatrix}
$$

Can someone explain the motivation behind this solution?

Best Answer

First, note that the unit direction vector in the $yz$-plane with elevation $\beta$ (and azimuth $0$) is $$\begin{pmatrix}0 \\ \cos \beta \\ \sin \beta\end{pmatrix}.$$ To produce from this the the unit direction vector with azimuth $\alpha$, we rotate clockwise about the z-axis, which we can regard as left multiplication by the matrix $$\begin{pmatrix}\cos \alpha & \sin \alpha & 0 \\ -\sin \alpha & \cos \alpha & 0 \\ 0 & 0 & 1\end{pmatrix},$$ so the desired vector is $$\begin{pmatrix}\cos \alpha & \sin \alpha & 0 \\ -\sin \alpha & \cos \alpha & 0 \\ 0 & 0 & 1\end{pmatrix}\begin{pmatrix}0 \\ \cos \beta \\ \sin \beta\end{pmatrix} = \color{#df0000}{\begin{pmatrix}\sin \alpha \cos \beta \\ \cos \alpha \cos \beta \\ \sin \beta\end{pmatrix}}.$$

Related Question