matrix
Class: simscape.multibody.Rotation
Namespace: simscape.multibody
Syntax
Input Arguments
R
— Rotation
object of subclass of simscape.multibody.Rotation
class
Rotation, specified as an object of a subclass of the simscape.multibody.Rotation
class.
Output Arguments
M
— Rotation matrix
3-by-3 matrix
Rotation matrix, returned as a 3-by-3 matrix. The rotation matrix is orthogonal and has determinate of 1.
Examples
Rotation Matrix for 3-D Rotation
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 are60
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
See Also
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)