Main Content

rigid2d

2-D rigid geometric transformation

Description

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

Creation

Description

tform = rigid2dcreates a defaultrigid2dobject that corresponds to an identity transformation.

tform = rigid2d(t)creates arigid2dobject based on a specified forward rigid transformation matrix,t. Thetinput sets theTproperty.

example

tform = rigid2d(rot,trans)creates arigid2dobject based on the rotation,rot, and translation,trans, components of the transformation.rotsets theRotationproperty.transsets theTranslationproperty.

Properties

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 number2.

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

invert 逆几何变换
isTranslation Determine if transformation is pure translation
outputLimits Find output spatial limits given input spatial limits
transformPointsForward Apply forward geometric transformation
transformPointsInverse Apply inverse geometric transformation

Examples

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];

创建一个rigid2dobject that performs the rotation and translation.

tform = rigid2d(rot,trans)
tform = rigid2d with properties: Rotation: [2x2 double] Translation: [2 3]

Version History

Introduced in R2020b