PlanetPhysics/Axis Angle of Rotation to Quaternions

Quaternions can be defined from the axis angle of rotation by

$$ \left[ \begin{matrix} q_1 \\ q_2 \\ q_3 \\ q_4 \end{matrix} \right] = \left[ \begin{matrix} e_1 sin( \alpha /2 ) \\ e_2 sin( \alpha /2 )  \\ e_3 sin( \alpha /2 )  \\ cos( \alpha /2 )  \end{matrix} \right] $$