Quaternion Rotation
R2026bRotate vector by quaternion
Libraries:
Aerospace Blockset /
Utilities /
Math Operations
Description
The Quaternion Rotation block calculates the resulting vector following the
passive rotation of initial vector vec by quaternion
q and returns a final vector, the rotated vector or vector of
rotated vectors. 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,
initial vector, and final vector, see Algorithms.
Examples
Ports
Input
Output
Programmatic Use: Add Block
To add the block programmatically, use the add_block function with one of these library block paths as the source.
"aerolibutil/Quaternion Rotation"
Example: add_block("aerolibutil/Quaternion Rotation","myModel/myBlock",MakeNameUnique="on")
Algorithms
The normalized quaternion has the form of
The vector has the form of
The Aerospace Blockset defines a passive quaternion rotation of the form:
where Ⓧ is the operator of a quaternion multiplication.
The final vector has the form of
References
[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.
Extended Capabilities
Version History
Introduced before R2006a

