Main Content

quatmod

Calculate modulus of quaternion

Description

example

n= quatmod(q)calculates the modulusnfor a given quaternion,q. For more information on the quaternion and quaternion modulus forms, seeAlgorithms.

Aerospace Toolboxuses quaternions that are defined using the scalar-first convention.

Examples

collapse all

Determine the modulus of q = [1 0 0 0].

mod = quatmod([1 0 0 0])
mod = 1

Input Arguments

collapse all

Quaternion, specified in am-by-4 matrix of real numbers containingmquaternions.

Example:[1 0 0 0]

Data Types:double

Output Arguments

collapse all

Moduli, returned as a column vector ofmelements.

Algorithms

The quaternion has the form of

q = q 0 + i q 1 + j q 2 + k q 3 .

四元数模数the form of

| q | = q 0 2 + q 1 2 + q 2 2 + q 3 2 .

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