주요 콘텐츠

eul

R2026b

Convert transformation or rotation into Euler angles

Since R2026b

    Description

    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.

    example

    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"

    These are orthonormal rotation matrices for rotations of ϕ, ψ, and θ about the x-, y-, and z-axis, respectively:

    Rx(ϕ)=[1000cosϕsinϕ0−sinϕcosϕ], Ry(ψ)=[cosψ0sinψ010−sinψ0cosψ], Rz(θ)=[cosθ−sinθ0sinθcosθ0001]

    When constructing the rotation matrix from this sequence, each character indicates the corresponding axis. For example, if the sequence is "XYZ", then the eul object constructs the rotation matrix R by multiplying the rotation about x-axis with the rotation about the y-axis, and then multiplying that product with the rotation about the z-axis:

    R=Rx(ϕ)·Ry(ψ)·Rz(θ)

    Example: eul([pi/2 pi/3 pi/4],"eul","ZYZ") rotates a point by pi/4 radians about the z-axis, then rotates the point by pi/3 radians about the y-axis, and then rotates the point by pi/2 radians about the z-axis. This is equivalent to eul(pi/2,"rotz") * eul(pi/3,"roty") * eul(pi/4,"rotz")

    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 R2026b

    See Also

    |