quatmod
Calculate modulus of quaternion
Syntax
Description
calculates
the modulus n = quatmod(q)n for a given quaternion, q. For more
information on the quaternion and quaternion modulus forms, see Algorithms.
Aerospace Toolbox uses quaternions that are defined using the scalar-first convention.
Examples
Comparing Quaternion Modulus Values
This example computes and prints the modulus of a quaternion.
q = quaternion([1, 2, 3, 4]);
qm = quatmod(q);
fprintf('Modulus of the quaternion: %.3f\n', qm);Modulus of the quaternion: 5.477
Determine Modulus of Quaternion
Determine the modulus of q = [1 0 0 0].
mod = quatmod([1 0 0 0])
mod = 1
Input Arguments
Output Arguments
Algorithms
The quaternion has the form of
The quaternion modulus has the form of
References
[1] Stevens, Brian L. and Frank L. Lewis. Aircraft Control and Simulation. 2nd ed. Wiley–Interscience, 2003.
Extended Capabilities
Version History
Introduced in R2006b
See Also
quatconj | quatdivide | quatinv | quatmultiply | quatnorm | quatnormalize | quatrotate | quaternion