Introductory Trail

This trail is meant for new students, or students who are looking for simple explanations of the content materials. Each section in here will also contain links to the appropriate sections in the advanced and programming sections.

Translation

Definition
A 2-dimensional translation is a transformation that moves a point a specified distance in the x and/or y directions (i.e. along either or both of the coordinate axes).

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