Main Content


3-D similarity geometric transformation


    A simtform3d object stores information about a 3-D similarity geometric transformation and enables forward and inverse transformations.



    tform = simtform3d creates a simtform3d object that performs an identity transformation.

    tform = simtform3d(scale,r,translation) creates a simtform3d object that performs a similarity transformation based on the specified scale factor scale, rotation matrix r, and amounts of translation in the x-, y-, and z-directions translation. The scale, r, and translation arguments set the Scale, R, and Translation properties, respectively.


    tform = simtform3d(Scale,eulerAngles,Translation) creates a simtform3d object that performs a similarity transformation based on Euler angles and the specified value of the Scale and Translation properties.

    tform = simtform3d(A) creates a simtform3d object and sets the property A to the specified 3-D similarity transformation matrix.

    tform = simtform3d(tformIn) creates a simtform3d object from another geometric transformation object, tformIn, that represents a valid 3-D similarity geometric transformation.

    Input Arguments

    expand all

    Euler angles in x,y,z order in degrees, specified as a 3-element numeric vector of the form [rx ry rz]. The Euler angles set the R property as a product of three rotation matrices (Rx, Ry, and Rz) according to:

     Rx = [1 0 0; 0 cosd(rx) -sind(rx); 0 sind(rx) cosd(rx)];
     Ry = [cosd(ry) 0 sind(ry); 0 1 0; -sind(ry) 0 cosd(ry)];
     Rz = [cosd(rz) -sind(rz) 0; sind(rz) cosd(rz) 0; 0 0 1];
      R = Rz*Ry*Rx;

    Data Types: double | single

    Similarity 3-D geometric transformation, specified as an affinetform3d object, rigidtform3d object, simtform3d object, or transltform3d object.


    expand all

    Forward 3-D similarity transformation, specified as a nonsingular 4-by-4 numeric matrix. The default of A is the identity matrix.

    The matrix A transforms the point (u, v, w) in the input coordinate space to the point (x, y, z) in the output coordinate space using the convention:


    For a similarity transformation, A has the form:


    where s is the scale factor and corresponds to the Scale property. R(i,j) are the elements of the rotation matrix specified by the corresponding (i,j) indices of the R property. tx, ty, and tz are the amount of translation in the x-, y-, and z-directions, respectively, and correspond to the elements of the Translation property.

    Data Types: double | single

    Scale factor, specified as a nonzero number. The scale factor corresponds to the value s in the similarity transformation matrix defined by property A.

    Data Types: double | single

    Rotation matrix, specified as a 3-by-3 numeric matrix. The rotation matrix performs rotation about the z-axis first, then the y-axis, and then the x-axis.

    Amount of translation, specified as a 3-element numeric vector of the form [tx ty tz].

    Data Types: double | single

    This property is read-only.

    Dimensionality of the geometric transformation for both input and output points, specified as 3.

    Data Types: double

    Object Functions

    invertInvert geometric transformation
    outputLimitsFind output spatial limits given input spatial limits
    transformPointsForwardApply forward geometric transformation
    transformPointsInverseApply inverse geometric transformation


    collapse all

    Specify the scale factor and the amount of translation. The transformation in this example does not perform rotation, so set the Euler angles to [0 0 0].

    scaleFactor = 1.5;
    eulerAngles = [0 0 0];
    translation = [10 20.5 15];

    Create a simtform3d object that performs the scaling and translation.

    tform = simtform3d(scaleFactor,eulerAngles,translation)
    tform = 
      simtform3d with properties:
        Dimensionality: 3
                 Scale: 1.5000
                     R: [3x3 double]
           Translation: [10 20.5000 15]
                     A: [4x4 double]

    Examine the value of the A property.

    ans = 4×4
        1.5000         0         0   10.0000
             0    1.5000         0   20.5000
             0         0    1.5000   15.0000
             0         0         0    1.0000

    Extended Capabilities

    Version History

    Introduced in R2022b