Conversion from euler angles to versors I am attempting to create a script to convert between the output of one long program and the input of another, neither of which I can edit. The output of the first gives euler angles for rotation and the input of the other requires a 3 float versor. All the online information I have been able to find on how to convert from euler angles to quaternions give 4 numbers and I don't know which 3 are needed for a versor. Please help

From this ref. we see how determine a unitary quaternion $z=a+b\mathbf{i}+c\mathbf{j}+c\mathbf{k}=a+\mathbf{v}$  that corresponds to three rotation around the coordinate axis (note that the quaternion depends on the order of the rotations not only from the angles).
We can write such unitary quaternion $z$ in polar form ( see: How can i express a quaternion in polar form?) as:
$$
z= e^ {\mathbf{n} \theta}
$$
where 
$$
\cos \theta=\dfrac{a}{|z|} \qquad \sin \theta=\dfrac{|\mathbf{v}|}{|z|} \qquad (1)$$
and
$$
\mathbf{n}=\dfrac{\mathbf{v}}{|z|\sin \theta}=\dfrac{\mathbf{v}}{|\mathbf v|}
\qquad (2)$$
Now a rotation of a vector $\vec u$ by an angle $2\theta$ around the axis oriented by the versor $\mathbf{n}$ is given by:
$$
R_{\mathbf{n},2\theta} (\vec u)=e^ {\mathbf{n} \theta}\,\vec u\, e^ {-\mathbf{n} \theta}
$$
So (2) gives the versor of the rotation an (1) the double angle.
