rod2angle

Convert Euler-Rodrigues vector to rotation angles

Description

example

[R1 R2 R3]=rod2angle(rod) function calculates the set of rotation angles, R1, R2, and R3, for a given Euler-Rodrigues (also known as Rodrigues) vector, rod.

[R1 R2 R3]=rod2angle(rod,S) function calculates the set of rotation angles for a given Rodrigues vector and a specified rotation sequence, S.

Examples

collapse all

Determine rotation angles from vector, [.1 .2 -.1].

r = [.1 .2 -.1];
[yaw, pitch, roll] = rod2angle(r)
yaw =

   -0.1651

pitch =

    0.4074

roll =

    0.1651

Input Arguments

collapse all

M-by-3 matrix containing M Rodrigues vector.

Data Types: double

Rotation angles, in radians, from which to determine Rodrigues vector. For the default rotation sequence, ZYX, the rotation angle order is:

  • R1 — z-axis rotation

  • R2 — y-axis rotation

  • R3 — x-axis rotation

Data Types: char | string

Output Arguments

collapse all

M-by-1 array of first rotation angles, in radians.

M-by-1 array of second rotation angles, in radians.

M-by-1 array of third rotation angles, in radians.

Algorithms

An Euler-Rodrigues vector b represents a rotation by integrating a direction cosine of a rotation axis with the tangent of half the rotation angle as follows:

b=[bxbybz]

where:

bx=tan(12θ)sx,by=tan(12θ)sy,bz=tan(12θ)sz

are the Rodrigues parameters. Vector s represents a unit vector around which the rotation is performed. Due to the tangent, the rotation vector is indeterminate when the rotation angle equals ±pi radians or ±180 deg. Values can be negative or positive.

References

[1] Dai, J.S. "Euler-Rodrigues formula variations, quaternion conjugation and intrinsic connections." Mechanism and Machine Theory, 92, 144-152. Elsevier, 2015.

Introduced in R2017a