## Documentation Center |

Calculate quaternion from rotation angles

The Rotation Angles to Quaternions block converts the rotation
described by the three rotation angles (R1, R2, R3) into the four-element
quaternion vector (*q*_{0}, *q*_{1}, *q*_{2}, *q*_{3}).
A quaternion vector represents a rotation about a unit vector
through an angle θ. A
unit quaternion itself has unit magnitude, and can be written in the
following vector format.

An alternative representation of a quaternion is as a complex number,

where, for the purposes of multiplication,

The benefit of representing the quaternion in this way is the ease with which the quaternion product can represent the resulting transformation after two or more rotations.

Input | Dimension Type | Description |
---|---|---|

First | 3-by-1 vector | Contains the rotation angles, in radians. |

Output | Dimension Type | Description |
---|---|---|

First | 4-by-1 matrix | Contains the quaternion vector. |

The limitations for the `'ZYX'`, `'ZXY'`, `'YXZ'`, `'YZX'`, `'XYZ'`,
and `'XZY'` implementations generate an R2 angle
that is between ±90 degrees, and R1 and R3 angles that are between
±180 degrees.

The limitations for the `'ZYZ'`, `'ZXZ'`, `'YXY'`, `'YZY'`, `'XYX'`,
and `'XZX'` implementations generate an R2 angle
that is between 0 and 180 degrees, and R1 and R3 angles that are between
±180 degrees.

Direction Cosine Matrix to Quaternions

Quaternions to Direction Cosine Matrix

Was this topic helpful?