Rotational Matrix Operations

Rotational Matrix Operations#

See also

For the background theory behind rotation matrices and frame transformations, see the Rigid Body Transformations concept page.

Functions

rotmat.rotx(phi)

Generate a 3x3 Direction Cosine Matrix for a positive rotation about the x-axis by an angle \(\varphi\) in radians.

rotmat.roty(theta)

Generate a 3x3 Direction Cosine Matrix for a positive rotation about the y-axis by an angle \(\theta\) in radians.

rotmat.rotz(psi)

Generate a 3x3 Direction Cosine Matrix for a positive rotation about the z-axis by an angle \(\psi\) in radians.

rotmat.dcm321([phi, theta, psi])

Generate a 3x3 Direction Cosine Matrix (DCM) for a sequence of positive rotations around the axes in the following order: \(z\), then \(y\), then \(x\).

rotmat.dcm321euler(dcm)

Extract Euler angles (roll, pitch, yaw) from a Direction Cosine Matrix (DCM) of 3-2-1 order.

rotmat.euler2quat([phi, theta, psi])

Converts 3-2-1 Euler angles to an attitude quaternion.

rotmat.quat2dcm(quat)

Returns a Body-from-Reference Direction Cosine Matrix (DCM) of an attitude quaternion.

rotmat.quat2euler(quat)

Extracts 3-2-1 Euler angles (roll, pitch, yaw) from an attitude quaternion.

animate.animate(rb, modelpath[, angle0, ...])

Animate a rigidbody.