Specifying a Translation
A transformation is usually specified by a
2-tuple, such as (2,3). The first number indicates movement along the
x-axis, and the second number indicates movement along the y-axis.
Undo'ing a Translation
If you have translated an object by (x,y), and you want to undo this, you need to translate the object again by (-x,-y).
Example
Here's an example of a translate on a square object. The example below
first translates the object by (2,-3) i.e. 2 units along the positive
x-axis and 3 units in the negative y-axis.The next translation is by
(-2,3). This pair of translations repeats.
| Back | Introductory Trail | Next | ||
| Index | Advanced Trail | Programmer's Trail | Game |