NiBabel

Access a cacophony of neuro-imaging file formats

Previous topic

nibabel.eulerangles.angle_axis2euler

Next topic

nibabel.eulerangles.euler2mat

This Page

Reggie -- the one

nibabel.eulerangles.euler2angle_axis

nibabel.eulerangles.euler2angle_axis(z=0, y=0, x=0)

Return angle, axis corresponding to these Euler angles

Uses the z, then y, then x convention above

Parameters :

z : scalar

Rotation angle in radians around z-axis (performed first)

y : scalar

Rotation angle in radians around y-axis

x : scalar

Rotation angle in radians around x-axis (performed last)

Returns :

theta : scalar

angle of rotation

vector : array shape (3,)

axis around which rotation occurs

Examples

>>> theta, vec = euler2angle_axis(0, 1.5, 0)
>>> theta
1.5
>>> np.allclose(vec, [0, 1, 0])
True