navigate.tools.linear_algebra.affine_rotation
- navigate.tools.linear_algebra.affine_rotation(x=0, y=0, z=0)
Calculate the general 3D affine transform for rotation.
Returns a rotation matrix for a rotation about the x, y, and z axes.
Rotation about x: [1, 0, 0, 0, 0, cos(theta), -sin(theta), 0, 0, sin(theta), cos(theta), 0, 0, 0, 0, 1]
Rotation about Y: [cos(theta), 0, sin(theta), 0, 0, 1, 0, 0, -sin(theta), 0, cos(theta), 0, 0, 0, 0, 1]
Rotation about Z: [cos(theta), -sin(theta), 0, 0, sin(theta), cos(theta), 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]
- Parameters:
x (float) – Rotation about the x axis in degrees.
y (float) – Rotation about the y axis in degrees.
z (float) – Rotation about the z axis in degrees.
- Returns:
affine_transform – A 4x4 affine transformation matrix.
- Return type:
numpy.ndarray