Main Content

transform

Apply rigid body transformation to points

Since R2023b

    Description

    tpoints = transform(transformation,points) applies the rigid body transformation transformation to the input points points, and returns the transformed points tpoints.

    tpoints = transform(rotation,points) applies the rotation rotation to the input points points, and returns the transformed points tpoints.

    tpoints = transform(___,isCol=format) sets the expected format of the input points points to be either column-wise or row-wise by using the logical flag format in addition to the input arguments from the previous syntax.

    Input Arguments

    collapse all

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

    If you specify transformation as an array, each element must be of the same type.

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

    If you specify rotation as an array, each element must be of the same type.

    Points to transform, specified as an N-by-D-by-M array, where:

    • D is the dimension of the transformation, defined as 2 for 2-D transformations and 3 for 3-D transformations.

    • N is the total number of input points to transform.

    • M is the total number of transforms to perform on each point.

    For 2-D transformations and rotations, each row specifies a point in the form [X Y]. For 3-D transformations and rotations, each row specifies a point in the form [X Y Z].

    If you specify format as true, then you must specify points as a D-by-N-by-M array, where each column specifies a point.

    Data Types: single | double

    Point format, specified as a logical 0 (false) or 1 (true). If you specify this argument as true, you must specify the points in points as columns. Otherwise, specify points as rows.

    Example: isCol=true

    Data Types: logical

    Output Arguments

    collapse all

    Transformed points, returned as an N-by-D-by-M array, where:

    • D is the dimension of the transformation, defined as 2 for 2-D transformations and rotations and 3 for 3-D transformations or rotations.

    • N is the total number of input points to transform.

    • M is the total number of transforms to perform on each point.

    For 2-D transformations and rotations, each row specifies a point in the form [X Y]. For 3-D transformations and rotations, each row specifies a point in the form [X Y Z].

    If you specify format as true, tpoints is returned as a D-by-N-by-M array, where each column specifies a point.

    Extended Capabilities

    C/C++ Code Generation
    Generate C and C++ code using MATLAB® Coder™.

    Version History

    Introduced in R2023b

    See Also

    Functions

    Objects