Main Content

interp

Interpolate between transformations

    Description

    transformation0 = interp(transformation1,transformation2,points) interpolates at normalized positions points between transformations transformation1 and transformation2.

    The function interpolates rotations using a quaternion spherical linear interpolation, and linearly interpolates translations.

    transformation0 = interp(transformation1,transformation2,N) interpolates N steps between transformations transformation1 and transformation2.

    Input Arguments

    collapse all

    First transformation, specified as an se2, se3, so2, or so3 object, or as an M-element array of transformation objects, where M is the total number of transformations. If you specify transformation1 as an array, each element must be of the same type.

    Either transformation1 or transformation2 must be a scalar transformation object of the same type. For example, if transformation1 is an array of se2 objects, transformation2 must be a scalar se2 object.

    Last transformation, specified as an se2, se3, so2, or so3 object, or as an M-element array of transformation objects, where M is the total number of transformations. If you specify transformation2 as an array, each element must be of the same type.

    Either transformation1 or transformation2 must be a scalar transformation object of the same type. For example, if transformation1 is an array of se2 objects, transformation2 must be a scalar se2 object.

    Normalized positions, specified as an N-element row vector of values in the range [0, 1], where N is the total number of interpolated positions. Normalized positions 0 and 1 correspond to the first and last transformations, respectively.

    Example: interp(transformation1,transformation2,0.5) interpolates a transformation halfway between transformation1 and transformation2.

    Number of interpolated positions, specified as a positive integer.

    Example: interp(transformation1,transformation2,5) interpolates five transformations between transformation1 and transformation2.

    Output Arguments

    collapse all

    Interpolated transformations, returned as an M-by-N matrix of the same transformation type as transformation1 and transformation2, where M is the length of the longer argument between transformation1 and transformation2, and N is the number of interpolated positions. Each row represents an interpolated transformation between transformation1 and transformation2.

    Extended Capabilities

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

    Version History

    Introduced in R2022b

    See Also

    Functions

    Objects