Main Content

# eul

Convert transformation or rotation into Euler angles

Since R2023a

## Description

example

angles = eul(transformation) converts the rotation of the transformation transformation to the Euler angles angles.

example

angles = eul(rotation) converts the rotation rotation to the Euler angles angles.

angles = eul(___,sequence) specifies the sequence of the Euler-angle rotations sequence using any of the input arguments in previous syntaxes. For example, a sequence of "ZYX" first rotates the z-axis, followed by the y-axis and x-axis.

## Examples

collapse all

Create SE(3) transformation with no translation but with a rotation defined by a Euler angles.

eul1 = [pi/4 pi/3 pi/8]
eul1 = 1×3

0.7854    1.0472    0.3927

T = se3(eul1,"eul")
T = se3
0.3536   -0.4189    0.8364         0
0.3536    0.8876    0.2952         0
-0.8660    0.1913    0.4619         0
0         0         0    1.0000

Get the Euler angles from the transformation.

eul2 = eul(T)
eul2 = 1×3

0.7854    1.0472    0.3927

Create SO(3) rotation defined by a Euler angles.

eul1 = [pi/4 pi/3 pi/8]
eul1 = 1×3

0.7854    1.0472    0.3927

R = so3(eul1,"eul")
R = so3
0.3536   -0.4189    0.8364
0.3536    0.8876    0.2952
-0.8660    0.1913    0.4619

Get the Euler angles from the transformation.

eul2 = eul(R)
eul2 = 1×3

0.7854    1.0472    0.3927

## Input Arguments

collapse all

Transformation, specified as an se3 object or as an N-element array of se3 objects. N is the total number of transformations.

Rotation, specified as an so3 object or as an N-element array of so3 objects. N is the total number of rotations.

Axis-rotation sequence for the Euler angles, specified as one of these string scalars:

• "ZYX" (default)

• "ZYZ"

• "ZXY"

• "ZXZ"

• "YXY"

• "YZX"

• "YXZ"

• "YZY"

• "XYX"

• "XYZ"

• "XZX"

• "XZY"

Each character indicates the corresponding axis. For example, if the sequence is "ZYX", then the three specified Euler angles are interpreted in order as a rotation around the z-axis, a rotation around the y-axis, and a rotation around the x-axis. When applying this rotation to a point, it will apply the axis rotations in the order x, then y, then z.

Data Types: string | char

## Output Arguments

collapse all

Euler angles, returned as an M-by-3 matrix of Euler rotation angles. Each row represents one Euler angle set.

## Version History

Introduced in R2023a