Closed formula to transform roll-pitch-yaw angles into Axis-angle representation

4k Views Asked by At

Can somebody give me closed formulas for the rotation axis, $\mathbf{n}(\psi,\theta,\phi)$, and the rotation angle $\alpha(\psi,\theta,\phi)$ of a rotation $R_{\mathbf{n},\alpha}= R_{\mathbf{z},\psi}R_{\mathbf{y},\theta}R_{\mathbf{x},\phi}$ which is given through the yaw, pitch, roll angles: $\psi$, $\theta$, $\phi$.

There are methods to obtain the rotation axis and angle from the rotation matrix and methods to obtain the rotation matrix from the yaw, pitch, roll angles, however a closed formula of the rotation axis and angle as a function of yaw, pitch and roll I have not found.

1

There are 1 best solutions below

3
On BEST ANSWER

Using quaternions, the scalar part of the resulting quaternion is equal to $\cos \frac{\alpha}{2}$. The vector part is proportional to the rotation axis $\hat n$.

That is,

$$\cos \frac{\alpha}{2} = \cos \frac{\psi}{2} \cos \frac{\theta}{2} \cos \frac{\phi}{2} + \sin \frac{\psi}{2} \sin \frac{\theta}{2} \sin \frac{\phi}{2}$$

and

$$n = i (\cos \frac{\psi}{2} \cos \frac{\theta}{2} \sin \frac{\phi}{2} - \sin \frac{\psi}{2} \sin \frac{\theta}{2} \cos \frac{\phi}{2}) + \text{cyclic permutations}$$

(That is to say, the remaining terms just permute the angles and the corresponding imaginary units, with one exception: the $j$ term has $+\sin \psi/2 \sin \phi/2 \cos \theta/2$, instead of $-$.)

You would then have to normalize $n$ to get a unit direction for the rotation axis.

In practice, I think it would be easier to multiply the quaternions in floating point arithmetic, rather than write out the net angle and axis as explicit functions of the rotation angles.