Main Content

Rotate vector by quaternion

**Library:**Aerospace Blockset / Utilities / Math Operations

The Quaternion Rotation block rotates a vector by a quaternion. Aerospace Blockset™ uses quaternions that are defined using the scalar-first convention. This block normalizes all quaternion inputs. For the equations used for the quaternion, vector, and rotated vector, see Algorithms.

The quaternion has the form of

$$q={q}_{0}+i{q}_{1}+j{q}_{2}+k{q}_{3}.$$

The vector has the form of

$$v=i{v}_{1}+j{v}_{2}+k{v}_{3}.$$

The rotated vector has the form of

$${v}^{\prime}=\left[\begin{array}{c}{v}_{1}{}^{\prime}\\ {v}_{2}{}^{\prime}\\ {v}_{3}{}^{\prime}\end{array}\right]=\left[\begin{array}{ccc}(1-2{q}_{2}^{2}-2{q}_{3}^{2})& 2({q}_{1}{q}_{2}+{q}_{0}{q}_{3})& 2({q}_{1}{q}_{3}-{q}_{0}{q}_{2})\\ 2({q}_{1}{q}_{2}-{q}_{0}{q}_{3})& (1-2{q}_{1}^{2}-2{q}_{3}^{2})& 2({q}_{2}{q}_{3}+{q}_{0}{q}_{1})\\ 2({q}_{1}{q}_{3}+{q}_{0}{q}_{2})& 2({q}_{2}{q}_{3}-{q}_{0}{q}_{1})& (1-2{q}_{1}^{2}-2{q}_{2}^{2})\end{array}\right]\left[\begin{array}{c}{v}_{1}\\ {v}_{2}\\ {v}_{3}\end{array}\right]$$

[1] Stevens, Brian L., Frank L.
Lewis. *Aircraft Control and Simulation*, Second Edition. Hoboken,
NJ: Wiley–Interscience.

[2] Diebel, James. "Representing Attitude: Euler Angles, Unit Quaternions, and Rotation Vectors." Stanford University, Stanford, California, 2006.

Quaternion Conjugate | Quaternion Division | Quaternion Inverse | Quaternion Multiplication | Quaternion Norm | Quaternion Normalize