Contenu principal

quaternion

R2026b

Class: simscape.multibody.Transformation
Namespace: simscape.multibody

Extract quaternion representation of rotation from transformation

Since R2026b

Description

q = quaternion(t) extracts the quaternion representation of the rotation of the specified transformation.

example

Input Arguments

expand all

Transformation, specified as a simscape.multibody.Transformation object.

Output Arguments

expand all

Rotation quaternion, returned as a 1-by-4 double array in the format [w x y z], where w is the scalar part and [x y z] is the vector part.

Attributes

Accesspublic

To learn about attributes of methods, see Method Attributes.

Examples

expand all

Extract the rotation quaternion from a simscape.multibody.Transformation object.

Create a rotation of 90 deg about the z-axis and convert it to a transformation.

rot = simscape.multibody.StandardAxisRotation(simscape.Value(90,"deg"),"+Z");
t = transformation(rot);

Extract the rotation quaternion in [w x y z] format.

q = quaternion(t)
q = 1x4 double
    0.7071         0         0    0.7071

Version History

Introduced in R2026b