Previous section-----Next section

RotationMatrix
2D/3D

RotationMatrix[bnum] returns the 2D/3D rotation matrix associated with body bnum.
• In Modeler2D, RotationMatrix[{ang}] or RotationMatrix[{ei, ej}] returns the rotation matrix associated with the given angle or Euler parameters.
• In Modeler3D, RotationMatrix[{ang, vector}] or RotationMatrix[{eo, ei, ej, ek}] returns the rotation matrix associated with the given angle and axis of rotation, or associated with the given Euler parameters.

• The 2D rotation matrix in terms of a rotation ang is defined as

• In terms of 2D Euler parameters, the rotation matrix is simply

• The 3D rotation matrix in terms of Euler parameters is defined as

• When transforming an angle-axis, the
Assumptions->Normalized option may be given to cause RotationMatrix to assume that vector is a unit vector, thus simplifying the result. The default setting is Assumptions->None.
• In Modeler3D, RotationMatrix[vector] returns the rotation matrix associated with the given virtual rotation vector {vx, vy, vz}.
• When RotationMatrix is used to transform a virtual rotation or an angle-axis, vector may be a simple vector or a Mech vector object with head Vector, Line, or Plane.
• See also: EulerParameters, Rotation, VirtualRotation.

Further Examples

Load the Modeler3D package.

Here is the rotation matrix for body 2, expressed in terms of Euler parameters.

Here is the rotation matrix representing a rotation of Pi/4 about the X axis.

Here is the rotation matrix generally representing a rotation about an axis, assuming that the given axis is normalized.