This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.


Determine if transformation is similarity transformation


TF = isSimilarity(tform)



TF = isSimilarity(tform) determines whether or not the affine transformation specified by tform is a similarity transformation.


collapse all

Create an affine2d object that defines a pure translation.

A = [ 1  0  0
      0  1  0
     40 40  1 ];

tform = affine2d(A)
tform = 

  affine2d with properties:

                 T: [3x3 double]
    Dimensionality: 2

Check if transformation is a similarity transformation.

tf = isSimilarity(tform)
tf =


Create an affine3d object that defines a different scale factor in each dimension.

Sx = 1.2;
Sy = 1.6;
Sz = 2.4;
tform = affine3d([Sx 0 0 0; 0 Sy 0 0; 0 0 Sz 0; 0 0 0 1])
tform = 

  affine3d with properties:

                 T: [4x4 double]
    Dimensionality: 3

Check if the transformation is a similarity transformation.

TF = isSimilarity(tform)
TF =


Input Arguments

collapse all

Geometric transformation, specified as an affine2d or affine3d geometric transformation object.

Output Arguments

collapse all

Flag indicating similarity transformation, returned as a logical scalar. TF is True when tform is a similarity transformation.

Data Types: logical

More About

collapse all

Similarity Transformation

A similarity transformation includes only rotation, translation, isotropic scaling, and reflection. A similarity transformation does not modify the shape of an input object. Straight lines remain straight, and parallel lines remain parallel.


isSimilarity returns True if the transformation includes reflection. Some toolbox functions, such as imregister, support only non-reflective similarity. Other functions, such as fitgeotrans, support reflection.

Introduced in R2013a