### Affine transformation

This modifier applies an affine transformation to the system. It may be used to translate, scale, rotate or shear the particles, the simulation cell and/or other elements. The transformation can either be specified explicitly in terms of a 3 x 3 matrix plus a translation vector, or implicitly by prescribing a fixed target shape for the simulation cell.

Given a 3 x 3 linear transformation matrix *M*
and a translation vector *t*,
which together describe a general affine transformation,
the new position *x'* of
a particle at the original position *x*
is computed as
*x'* = *M*⋅*x* + *t*.
This notation uses column vectors.

The

button opens a dialog box letting you specify a rotation axis, a rotation angle and a center of rotation. Based on these inputs, OVITO will compute the corresponding affine transformation matrix for you.#### Transform to target box

This option lets the modifier automatically compute the affine transformation from the current shape of the input simulation cell and the specified target shape. After application of the implicitly determined transformation, the existing simulation cell will be mapped the given target cell shape. The contents of the simulation cell (e.g. particles, surface meshes, etc.) will be mapped to the new cell shape accordingly, unless you turn off their transformation (see next section).

Note that you can use this option to replace a varying simulation cell loaded from the input simulation file(s) with a static, non-varying simulation cell.

#### Transformed elements

You can select the types of data elements that should be transformed by the modifier:

Data element type | Description |
---|---|

Particles | Applies the affine transformation to the coordinates of particles (i.e. the |

Vector particle properties | Applies the linear part of the affine transformation to the |

Simulation cell | Applies the affine transformation to the origin of the simulation cell and the linear part of the transformation to the three cell vectors. |

Surfaces | Applies the affine transformation to the vertices of surface meshes. |

Voxel grids | Applies the affine transformation to the domain shape of a voxel grid. |

Dislocations | Applies the affine transformation to a set of dislocation lines. |

The option *Transform selected elements only* restricts the application of the transformation to
the currently selected particles.