Engee documentation

Quaternions to Rotation Angles

Calculation of the rotation vector from the quaternion vector.

blockType: SubSystem

Path in the library:

/Aerospace/Axes Transformations/Quaternions to Rotation Angles

Description

Block Quaternions to Rotation Angles converts a four-element vector of quaternions ( ) in a turn described by three angles ( ). Elements of the matrix of guiding cosines are functions of the unit vector of the quaternion. For example, for the rotation order - - the matrix It is defined as follows:

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

The following relations between the elements can be derived from the above equations and separate rotation angles for rotation - - :











where

  • — This is ;

  • — 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