Main Content


Class: simscape.multibody.Rotation
Package: simscape.multibody

Compute equivalent rotation sequence angles

Since R2023a


seq = sequenceAngles(R,axes,sequence)


seq = sequenceAngles(R,axes,sequence) computes a set of rotation sequence angles to represent the provided rotation, R. The rotation sequence angles correspond to three successive elementary rotations. The sequenceAngles method computes the angles based on the specification of the axes and sequence.

Input Arguments

expand all

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

Selection of rotation axes, specified as either the simscape.multibody.FrameSide.Follower or simscape.multibody.FrameSide.Base member. To compute angles for intrinsic or extrinsic rotations, use the simscape.multibody.FrameSide.Follower or simscape.multibody.FrameSide.Base member, respectively. For more information about the intrinsic or extrinsic rotations, see Rotation Sequence Measurements.

Sequence of three axes to rotate about, specified as a member of the simscape.multibody.AxisSequence class. Use one of the following members:

  • simscape.multibody.AxisSequence.XYX

  • simscape.multibody.AxisSequence.XYZ

  • simscape.multibody.AxisSequence.XZX

  • simscape.multibody.AxisSequence.XZY

  • simscape.multibody.AxisSequence.YXY

  • simscape.multibody.AxisSequence.YXZ

  • simscape.multibody.AxisSequence.YZX

  • simscape.multibody.AxisSequence.YZY

  • simscape.multibody.AxisSequence.ZXY

  • simscape.multibody.AxisSequence.ZXZ

  • simscape.multibody.AxisSequence.ZYX

  • simscape.multibody.AxisSequence.ZYZ

Output Arguments

expand all

Rotation sequence angles, specified as a simscape.Value object that represents a 3-by-1 column vector. Each element of the array is an angle.

The unit of the angles depends on which rotation subclass is used to create the object R. If the subclass, such as the simscape.multibody.StandardAxisRotation class, has an angular input argument, the unit of the rotation sequence angles matches with the angular unit specified in the subclass. If the subclass, such as the simscape.multibody.RotationMatrixRotation class, does not have an angular input argument, the rotation sequence angles are in degrees.

The sequenceAngles method and the Sequence parameter of the Transform Sensor block work similarly when computing rotation sequence angles. For more information about the computed angles and how the sequenceAngles method deals with locking issues, such the gimbal lock problem, see Rotation Sequence Measurements.



To learn about attributes of methods, see Method Attributes.


expand all

This example shows how to compute equivalent rotation sequence angles for a rotation object constructed by the simscape.multibody.StandardAxisRotation class.

Use the StandardAxisRotation class to construct a rotation object R that represents a rotation about the x-axis of the base frame. The rotation angle is 1.05 rad.

angle = simscape.Value(1.05,"rad");
axis = simscape.multibody.Axis.PosX;
R = simscape.multibody.StandardAxisRotation(angle,axis);

Use the sequenceAngles method to compute the rotation sequence angles of the object R. Specify the base frame as the reference fame and X-Y-Z as the rotation sequence.

axes = simscape.multibody.FrameSide.Base;
sequence = simscape.multibody.AxisSequence.XYZ;
seq = sequenceAngles(R,axes,sequence)
seq = 

    : rad

Version History

Introduced in R2023a