# quatnorm

Calculate norm of quaternion

## Syntax

``norm = quatnorm(q)``

## Description

example

````norm = quatnorm(q)` calculates the norm `norm` for a given quaternion, `q`. For more information on the quaternion and quaternion norm forms, see Algorithms.Aerospace Toolbox uses quaternions that are defined using the scalar-first convention.```

## Examples

collapse all

Determine the norm of `q = [.5 -.5 .5 0]`.

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

## Input Arguments

collapse all

Quaternion matrix, specified in an m-by-4 matrix of real numbers containing m quaternions.

Example: `[1 0 0 0]`

Data Types: `double`

## Output Arguments

collapse all

Norms, returned as a column vector of m norms.

## Algorithms

The quaternion has the form of

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

The quaternion norm has the form of

`$norm\left(q\right)={q}_{0}^{2}+{q}_{1}^{2}+{q}_{2}^{2}+{q}_{3}^{2}.$`

 Stevens, Brian L. and Frank L. Lewis. Aircraft Control and Simulation. 2nd ed. Wiley–Interscience, 2003.