Engee documentation

Quaternions to Rotation Angles

Page in progress.

Calculating the rotation vector from the vector of quaternions.

blockType: SubSystem

Path in the library:

/Aerospace/Axes Transformations/Quaternions to Rotation Angles

Description

The block Quaternions to Rotation Angles converts a four-element quaternion vector ( ) into a rotation described by three angles ( ). The elements of the directional cosine matrix are functions of the unit vector of quaternions. For example, for the order of rotation - - , the matrix is defined as follows:

The matrix , defined by the unit vector of the quaternion, is:

From the above equations, we can derive the following relations between the elements of and the individual rotation angles for rotation - - :











where

  • - it’s ;

  • - this is ;

  • - this is .

Ports

Input

# q — quaternion
`vector 4 by 1

Details

A quaternion given as a 4 by 1 vector.

Data types

Float64.

Complex numbers support

No

Output

# [R1, R2, R~3] — rotation angles
`vector 3 to 1

Details

Rotation angles returned as a 3 by 1 vector.

Data types

Float64.

Complex numbers support

No

Parameters

Parameters

# Rotation order — rotation order
ZYX | ZYZ | ZXY | ZXZ | YXZ | YXY | YZX | YZY | XYZ | XYX | XZY | XZX

Details

Select the rotation order for the three rotation angles.

Values

ZYX | ZYZ | ZXY | ZXZ | YXZ | YXY | YZX | YZY | XYZ | XYX | XZY | XZX

Default value

ZYX

Program usage name

rotation_order

Tunable

No

Evaluatable

Yes