# quatnormalize

Normalize quaternion

## Syntax

``normalized_q = quatnormalize(q)``

## Description

example

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

## Examples

collapse all

Normalize q = [1 0 1 0].

`normal = quatnormalize([1 0 1 0])`
```normal = 1×4 0.7071 0 0.7071 0 ```

## 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

Normalized quaternions, returned in an m-by-4 matrix.

## Algorithms

The quaternion has the form of

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

The normalized quaternion has the form of

`$normal\left(q\right)=\frac{{q}_{0}+i{q}_{1}+j{q}_{2}+k{q}_{3}}{\sqrt{{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.