Main Content


2-D rigid geometric transformation


A rigid2d object stores information about a 2-D rigid geometric transformation and enables forward and inverse transformations.



tform = rigid2d creates a default rigid2d object that corresponds to an identity transformation.

tform = rigid2d(t) creates a rigid2d object based on a specified forward rigid transformation matrix, t. The t input sets the T property.


tform = rigid2d(rot,trans) creates a rigid2d object based on the rotation, rot, and translation, trans, components of the transformation. rot sets the Rotation property. trans sets the Translation property.


expand all

Forward rigid transformation, specified as a 3-by-3 numeric matrix.

Data Types: single | double

This property is read-only.

Dimensionality of the geometric transformation, specified as the number 2.

Rotation component of the transformation, specified as a 2-by-2 numeric matrix.

Data Types: single | double

Translation component of the transformation, specified as a 2-element numeric row vector.

Data Types: single | double

Object Functions

invertInvert geometric transformation
isTranslationDetermine if transformation is pure translation
outputLimitsFind output spatial limits given input spatial limits
transformPointsForwardApply forward geometric transformation
transformPointsInverseApply inverse geometric transformation


collapse all

Specify an angle of rotation in degrees and create a 2-by-2 rotation matrix.

theta = 30;
rot = [ cosd(theta) sind(theta); ...
       -sind(theta) cosd(theta)];

Specify the amount of horizontal and vertical translation, respectively.

trans = [2 3];

Create a rigid2d object that performs the rotation and translation.

tform = rigid2d(rot,trans)
tform = 
  rigid2d with properties:

       Rotation: [2x2 double]
    Translation: [2 3]

Introduced in R2020b