# se3

SE(3) homogeneous transformation

## Description

The `se3` represents an SE(3) transformation as a homogeneous transformation matrix consisting of a translation and rotation in 3-D.

This object acts like a numerical matrix enabling you to compose poses using multiplication and division.

## Creation

### Syntax

``transformation = se3``
``transformation = se3(rotation)``
``transformation = se3(rotation,translation)``
``transformation = se3(transformation)``

### Description

````transformation = se3` creates an SE(3) transformation representing an identity rotation with no translation.```
````transformation = se3(rotation)` creates an SE(3) transformation representing a pure rotation defined by the orthonormal rotation `rotation` with no translation. The rotation matrix is represented by the elements in the top left of the matrix.```

````transformation = se3(rotation,translation)` creates an SE(3) transformation representing a rotation defined by the orthonormal rotation `rotation`, and the translation `translation`. The function applies the rotation matrix first and the translation vector second.```
````transformation = se3(transformation)` creates an SE(3) transformation representing a translation and rotation as defined by the homogeneous transformation `transformation`.```

### Input Arguments

expand all

Orthonormal rotation, specified as a 3-by-3 matrix, a 3-by-3-byM array, a scalar `so3` object, or an M-element array of `so3` objects. M is the total number of rotations.

If `rotation` contains more than one rotation and you also specify `translation` at construction, the number of translations in `translation` must be one or equal to the number of rotations in `rotation`. The resulting number of transformation objects is equal to the larger argument between `translation` and `rotation`.

Example: `eye(3)`

Data Types: `single` | `double`

Translation, specified as a N-by-3 array. N is the total number of translations and each translation is of the form [X Y Z].

If `translation` contains more than one translation, the number of rotations in `rotation` must be one or equal to the number of translations in `translation`. The resulting number of created transformation objects is equal to the larger argument between `translation` and `rotation`.

Example: `[1 4 3]`

Data Types: `single` | `double`

Homogeneous transformation, specified as a 4-by-4 matrix, a 4-by-4-T or an `se3` object. T is the total number of transformations specified.

If `transformation` is an array, the resulting number of created transformations objects is equal to T.

Example: `eye(4)`

Data Types: `single` | `double`

## Object Functions

 `dist` Calculate distance between transformations `interp` Interpolate between transformations `mrdivide, ./` Transformation right division `mtimes, *` Transformation multiplication `normalize` Normalize transformation matrix `rdivide, ./` Element-wise transformation right division `rotm` Extract rotation matrix `times, .*` Transformation element-wise multiplication `tform` Extract homogeneous transformation `transform` Apply rigid body transformation to points `trvec` Extract translation vector

## Examples

collapse all

Define a 3-by-3 rotation matrix and a three-element translation vector.

```rot = eye(3); tr = [3 5 2];```

Create the SO(2) and SO(3) rotations using the rotation matrix `rot`.

`R2d = so2(rot(1:2,1:2))`
```R2d = so2 1 0 0 1 ```
`R3d = so3(rot)`
```R3d = so3 1 0 0 0 1 0 0 0 1 ```

Create the SE(2) and SE(3) rotations using the rotation matrix `rot`, and the translation vector `tr`.

`T2d = se2(rot(1:2,1:2),tr(1:2))`
```T2d = se2 1 0 3 0 1 5 0 0 1 ```
`T3d = se3(rot,tr)`
```T3d = se3 1 0 0 3 0 1 0 5 0 0 1 2 0 0 0 1 ```

## Version History

Introduced in R2022b