Main Content

# simscape.multibody.QuaternionRotation class

Package: simscape.multibody
Superclasses: `simscape.multibody.Rotation`

Construct rotation by using unit quaternion

## Description

Use an object of the `simscape.multibody.QuaternionRotation` class to construct a 3-D rotation by using a `quaternion` object. A `quaternion` object is a four-element unit vector,

$Q=\left(\begin{array}{cc}S& V\end{array}\right)$,

where:

$S=\mathrm{cos}\left(\frac{\theta }{2}\right)$,

and

$V=\left[{U}_{x}\text{\hspace{0.17em}}{U}_{y}\text{\hspace{0.17em}}{U}_{z}\right]\mathrm{sin}\left(\frac{\theta }{2}\right)$.

θ is the angle of rotation and [Ux, Uy, Uz] is the unit vector of the rotational axis. Note that for any given rotation, there are two quaternions that are negatives of each other, but represent the same rotation. For example, the quaternions [`1` `0` `0` `0`] and [`-1` `0` `0` `0`] both represent the identity rotation.

### Class Attributes

 `Sealed` `true` `ConstructOnLoad` `true` `RestrictsSubclassing` `true`

For information on class attributes, see Class Attributes.

## Creation

### Description

````R = simscape.multibody.QuaternionRotation` creates a rotation with default quaternion.```
````R = simscape.multibody.QuaternionRotation(Q)` creates a rotation with the specified quaternion.```

## Properties

expand all

Unit quaternion, specified as a `quaternion` object that represents a four-element unit vector.

Example: `0.70711 + 0.40825i + 0.40825j + 0.40825k`

#### Attributes:

 `GetAccess` `public` `SetAccess` `public` `NonCopyable` `true`

## Version History

Introduced in R2022a

## See Also

| (Robotics System Toolbox)