# rigid2d

(Not recommended) 2-D rigid geometric transformation using postmultiply convention

Since R2020b

`rigid2d` is not recommended. Use the `rigidtform2d` object instead. For more information, see Compatibility Considerations.

## Description

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

## Creation

### Syntax

``tform = rigid2d``
``tform = rigid2d(t)``
``tform = rigid2d(rot,trans)``

### Description

````tform = rigid2d` creates a default `rigid2d` object that corresponds to an identity transformation.```
````tform = rigid2d(t)` sets the `T` property as the specified 2-D rigid transformation matrix `t`.```

example

````tform = rigid2d(rot,trans)` sets the `Rotation` and `Translation` properties as the specified rotation matrix `rot` and translation vector `trans`, respectively.```

## Properties

expand all

Forward rigid transformation, specified as a 3-by-3 numeric matrix. The matrix `T` satisfies the postmultiply convention given by:

`[x y 1] = [u v 1] * ``Rotation` + `Translation`

Data Types: `single` | `double`

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`

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

## Object Functions

 `invert` Invert geometric transformation `isTranslation` Determine if geometric 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];`

Create a `rigid2d` object 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

expand all