Main Content

angle2rod

Convert rotation angles to Euler-Rodrigues vector

Description

rod=angle2rod(R1,R2,R3) function converts the rotation described by the three rotation angles, R1, R2, and R3, into an M-by-3 Euler-Rodrigues (Rodrigues) matrix, rod. The rotation angles represent a series of right-hand intrinsic passive rotations from frame A to frame B. The resulting Euler-Rodrigues vector represents a right-hand passive rotation from frame A to frame B.

rod=angle2rod(R1,R2,R3,S) function converts the rotation described by the three rotation angles and a rotation sequence, S, into an M-by-3 Euler-Rodrigues array, rod, that contains the M Rodrigues vector.

example

Examples

collapse all

Determine the Rodrigues vector from rotation angles.

yaw = 0.7854;
pitch = 0.1;
roll = 0;
r = angle2rod(yaw,pitch,roll)
r = 1×3

   -0.0207    0.0500    0.4142

Determine the Rodrigues vectors from multiple rotation angles.

yaw = [0.7854 0.5];
pitch = [0.1 0.3];
roll = [0 0.1];
r = angle2rod(pitch,roll,yaw,'YXZ')
r = 2×3

    0.0207    0.0500    0.4142
    0.0885    0.1381    0.2473

Input Arguments

collapse all

First rotation angle, in radians, from which to determine Euler-Rodrigues vector. Values must be real.

Data Types: double | single

Second rotation angle, in radians, from which to determine Euler-Rodrigues vector. Values must be real.

Data Types: double | single

Third rotation angle, in radians, from which to determine Euler-Rodrigues vector. Values must be real.

Data Types: double | single

Rotation sequence. 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

Euler-Rodrigues vector determined from rotation angles.

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.

Version History

Introduced in R2017a