Specifying a Scale
A scale operation is specified by a 2-tuple, such as (0.5, 1). Again, the
first number refers to the scale along the x-axis, and the second number
refers to the scale along the y-axis.
Undo'ing a Scaled
If you have scaled an object by (x,y), and you want to undo this, you need to scale the object again by (1/x,1/y).
Example
The example below shows a scale of (2,0.5) i.e. a scale along the
x-axis by a factor of 2, and a scale along the y-axis by a factor of
0.5. The second scaling reverses the first scaling so as to get back
the original size and shape of the object. Also, notice that the
object moves to a different position. This is due to the fact
that the object is not at the origin, and as such will suffer the
side-effect of being moved to a different position, since the scale is
with respect to the origin.
| Back | Introductory Trail | Next | ||
| Index | Advanced Trail | Programmer's Trail | Game |