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.

Scale

Definition
A scaling is a transformation that changes the relative size and possibly the position of the object. Scaling can be performed along either or both of the coordinate axes. A scale by a factor of more than 1 will increase the object's size. A scale by a positive factor of less than 1 will decrease the object's size. A scale by a factor of 1 will not change the object size.

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