Main Content

matrix

Class: simscape.multibody.Rotation
Namespace: simscape.multibody

Compute rotation matrix

Since R2022a

Description

M = matrix(R) computes the rotation matrix of the rotation R.

example

Input Arguments

expand all

Rotation, specified as an object of a subclass of the simscape.multibody.Rotation class.

Output Arguments

expand all

Rotation matrix, returned as a 3-by-3 matrix. The rotation matrix is orthogonal and has determinate of 1.

Attributes

Accesspublic

To learn about attributes of methods, see Method Attributes.

Examples

expand all

Construct a 3-D Rotation

You can construct a rotation by using a subclass of the simscape.multibody.Rotation class.

  • Use the simscape.multibody.RotationSequenceRotation class to construct a 3-D rotation. This 3-D rotation composes of three subsequent rotations about the z, y, and x axes of the follower frame, respectively. The corresponding angles are 60 deg, 5 deg, and -5 deg.

sequence = simscape.multibody.AxisSequence.ZYX;
axes = simscape.multibody.FrameSide.Follower;
angles = simscape.Value([60 5 -5],"deg");
R = simscape.multibody.RotationSequenceRotation(axes,sequence,angles);

Rotation Matrix

  • To compute the rotation matrix for the constructed 3-D rotation, you can use the matrix method.

A = matrix(R)
A = 3×3

    0.4981   -0.8665   -0.0321
    0.8627    0.4915    0.1188
   -0.0872   -0.0868    0.9924

The column vectors A(:,1), A(:,2), and A(:,3) respectively express the x, y, and z axes of the follower frame in base frame coordinates.

Version History

Introduced in R2022a