# xytheta

Convert transformation or rotation to compact 2-D pose representation

Since R2023b

## Syntax

``pose = xytheta(transformation)``
``pose = xytheta(rotation)``

## Description

example

````pose = xytheta(transformation)` converts a transformation `transformation` to a compact 2-D pose representation `pose`.```

example

````pose = xytheta(rotation)` converts a rotation `rotation` to a compact 2-D pose representation `pose` with no translation.```

## Examples

collapse all

Create SE(2) transformation with an xy-position of `[2 3]` and a rotation defined by an angle `pi/2`.

```pose1 = [2 3 pi/2]; T = se2(pose1,"xytheta")```
```T = se2 0.0000 -1.0000 2.0000 1.0000 0.0000 3.0000 0 0 1.0000 ```

Convert the transformation back into a compact pose.

`pose2 = xytheta(T)`
```pose2 = 1×3 2.0000 3.0000 1.5708 ```

Create SO(2) rotation defined by an angle `pi/2`.

`angle = pi/2`
```angle = 1.5708 ```
`R = so2(angle,"theta")`
```R = so2 0.0000 -1.0000 1.0000 0.0000 ```

Convert the transformation back into a compact pose.

`pose = xytheta(R)`
```pose = 1×3 0 0 1.5708 ```

## Input Arguments

collapse all

Transformation, specified as an `se2` object or as an N-element array of `se2` objects. N is the total number of transformations.

Data Types: `single` | `double`

Rotation, specified as an `so2` object or as an N-element array of `so2` objects. N is the total number of rotations.

## Output Arguments

collapse all

2-D compact pose, returned as an N-by-3 matrix, where each row is of the form [x y theta]. N is the total number of transformations specified. x and y are the xy-position and theta is the rotation about the z-axis.

## Version History

Introduced in R2023b