NiBabel

Access a cacophony of neuro-imaging file formats

Previous topic

nibabel.quaternions.rotate_vector

Next topic

nibabel.quaternions.angle_axis2quat

Reggie -- the one

nibabel.quaternions.angle_axis2mat

nibabel.quaternions.angle_axis2mat(theta, vector, is_normalized=False)

Rotation matrix of angle theta around vector

Parameters:

theta : scalar

angle of rotation

vector : 3 element sequence

vector specifying axis for rotation.

is_normalized : bool, optional

True if vector is already normalized (has norm of 1). Default False

Returns:

mat : array shape (3,3)

rotation matrix specified rotation

Notes

From: http://en.wikipedia.org/wiki/Rotation_matrix#Axis_and_angle