Main Content

angvel

Angular velocity from quaternion array

Description

example

AV = angvel(Q,dt,'frame') returns the angular velocity array from an array of quaternions, Q. The quaternions in Q correspond to frame rotation. The initial quaternion is assumed to represent zero rotation.

AV = angvel(Q,dt,'point') returns the angular velocity array from an array of quaternions, Q. The quaternions in Q correspond to point rotation. The initial quaternion is assumed to represent zero rotation.

[AV,qf] = angvel(Q,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 quaternions.

Data Types: quaternion

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.

Data Types: quaternion

Output Arguments

collapse all

Angular velocity, returned as an N-by-3 real matrix. N is the number of quaternions given in the input Q. Each row of the matrix corresponds to an angular velocity vector.

Final quaternion, returned as a quaternion. qf is the same as the last quaternion in the Q input.

Data Types: quaternion

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

Introduced in R2020a