Transform Command

From OSUPDOCS
Jump to navigation Jump to search

Introduction

A standard Region command will allocate particles within shapes defined for that region and those particles will by aligned with the grid. Depending on the current number of particle per cell, the command will assign particles to specific locations within cells. The transform options on this page add new options for moving particle away from the standard locations.

Transforming Created Particles

To transform all particles within the current Region command when running 2D simulations and using script input, use the command:

Transform (angle),(Tx),(Ty),(Ox),(Oy)

Each particle will be an initial (or "init") location by standard methods as if it was not being transformed and then the location of that particle will change a "new" position defined by

      [math]\displaystyle{ \vec X_p^{(new)} = \vec X_p^{(init)} + (\mathbf{R}-\mathbf{i})(\vec X_p^{(init)} - \vec O) + \vec T }[/math]

where [math]\displaystyle{ \mathbf{R} }[/math] is 2D rotation matrix for rotation about the z axis by specified (angle) (in degrees), [math]\displaystyle{ \mathbf{I} }[/math] is the identity matrix, [math]\displaystyle{ \vec O = ((Ox),(Oy)) }[/math] is the origin for the rotation (in length units) and [math]\displaystyle{ \vec T = ((Tx),(Ty)) }[/math] is a translation (in)