Main Content

axang

Convert transformation or rotation into axis-angle rotations

Since R2023a

    Description

    angles = axang(transformation) converts the rotation of the transformation transformation to the axis-angle rotations angles.

    example

    angles = axang(rotation) converts the rotation rotation to the axis-angle rotations angles.

    example

    Examples

    collapse all

    Create SE(3) transformation with no translation but with a rotation defined by an axis-angle rotation. Define the axis-rotation with vector of [0.5 0.25 0.5] to be the axis and a pi/2 rotation about that axis.

    axa1 = [0.5 0.25 0.5 pi/2];
    T = se3(axa1,"axang");

    Get the axis-angle rotation from the transformation.

    axa2 = axang(T)
    axa2 = 1×4
    
        0.6667    0.3333    0.6667    1.5708
    
    

    Create SO(3) transformation with a rotation defined by an axis-angle rotation. Define the axis-rotation with vector of [0.5 0.25 0.5] to be the axis and a pi/2 rotation about that axis.

    axa1 = [0.5 0.25 0.5 pi/2];
    R = so3(axa1,"axang");

    Get the axis-angle rotation from the transformation. Note that the vector of the axis-angle rotation has a different magnitude from the axis-angle rotation specified to the transformation but the defined axis and rotation are the same.

    axa2 = axang(R)
    axa2 = 1×4
    
        0.6667    0.3333    0.6667    1.5708
    
    

    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.

    Output Arguments

    collapse all

    Axis-angle rotation angles, specified as an N-by-4 matrix of N axis-angle rotations. The first three elements of every row specify the rotation axes, and the last element defines the rotation angle, in radians.

    Version History

    Introduced in R2023a

    See Also

    |