# angvel

Angular velocity from quaternion array

Since R2020a

## Syntax

``AV = angvel(quat,dt,"frame")``
``AV = angvel(quat,dt,"point")``
``[AV,qf] = angvel(quat,dt,fp,qi)``

## Description

example

````AV = angvel(quat,dt,"frame")` returns the angular velocity array from an array of quaternions, `quat`. The quaternions in `quat` correspond to frame rotation. The initial quaternion is assumed to represent zero rotation. ```
````AV = angvel(quat,dt,"point")` returns the angular velocity array from an array of quaternions, `quat`. The quaternions in `quat` correspond to point rotation. The initial quaternion is assumed to represent zero rotation. ```
````[AV,qf] = angvel(quat,dt,fp,qi)` allows you to specify the initial quaternion, `qi`, and the type of rotation, `fp`. It also returns the final quaternion, `qf`.```

## Examples

collapse all

Create an array of quaternions.

```eulerAngles = [(0:10:90).',zeros(numel(0:10:90),2)]; q = quaternion(eulerAngles,'eulerd','ZYX','frame');```

Specify the time step and generate the angular velocity array.

```dt = 1; av = angvel(q,dt,'frame') % units in rad/s```
```av = 10×3 0 0 0 0 0 0.1743 0 0 0.1743 0 0 0.1743 0 0 0.1743 0 0 0.1743 0 0 0.1743 0 0 0.1743 0 0 0.1743 0 0 0.1743 ```

## Input Arguments

collapse all

Quaternions, specified as an N-by-1 vector of `quaternion` objects.

Time step, specified as a nonnegative scalar.

Data Types: `single` | `double`

Type of rotation, specified as `"frame"` or `"point"`.

Initial quaternion, specified as a `quaternion` object.

## Output Arguments

collapse all

Angular velocity, returned as an N-by-3 real matrix, where N is the number of quaternions in the `quat` argument. Each row of the matrix corresponds to an angular velocity vector.

Final quaternion, returned as a `quaternion` object. `qf` is the same as the last quaternion in the `quat` argument.

## Version History

Introduced in R2020a