Main Content

# so2

SO(2) rotational transformation

## Description

The `so2` object represents an SO(2) rotational transformation in 2-D.

This object acts like a numerical matrix enabling you to compose poses using multiplication and division.$\mathrm{cos}\left(\frac{\alpha }{2}\right)+\mathrm{sin}\left(\frac{\alpha }{2}\right)\left(xi+yj+zk\right)$

## Creation

### Syntax

``transformation = so2``
``transformation = so2(rotation)``

### Description

````transformation = so2` creates an SO(2) rotational transformation representing an identity rotation with no translation.```

example

````transformation = so2(rotation)` creates an SO(2) rotational transformation `transformation` representing a pure rotation defined by the orthonormal rotation `rotation`.```

### Input Arguments

expand all

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

The resulting number of transformation objects is equal to the larger argument between `translation` and `rotation`

Example: `eye(3)`

Data Types: `single` | `double`

## Object Functions

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

## 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