Convert quaternion to rotation of angle around axis
Parameters : | quat : 4 element sequence
identity_thresh : None or scalar, optional
|
---|---|
Returns : | theta : scalar
vector : array shape (3,)
|
Notes
A quaternion for which x, y, z are all equal to 0, is an identity rotation. In this case we return a 0 angle and an arbitrary vector, here [1, 0, 0]
Examples
>>> theta, vec = quat2angle_axis([0, 1, 0, 0])
>>> np.allclose(theta, np.pi)
True
>>> vec
array([ 1., 0., 0.])
If this is an identity rotation, we return a zero angle and an arbitrary vector
>>> quat2angle_axis([1, 0, 0, 0])
(0.0, array([ 1., 0., 0.]))