quatnorm

Calculate norm of quaternion

Syntax

n = quatnorm(q)

Description

n = quatnorm(q) calculates the norm, n, for a given quaternion, q. Input q is an m-by-4 matrix containing m quaternions. n returns a column vector of m norms. Each element of q must be a real number.

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

The quaternion has the form of

q=q0+iq1+jq2+kq3

The quaternion norm has the form of

norm(q)=q02+q12+q22+q32

Examples

Determine the norm of q = [1 0 0 0]:

norm=quatnorm([.5 -.5 .5 0])

norm =

    0.7500

References

[1] Stevens, Brian L., Frank L. Lewis, Aircraft Control and Simulation, Wiley–Interscience, 2nd Edition.

Extended Capabilities

Introduced in R2006b