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.

Shear

Definition
A shear is a transformation that distorts the shape of an object along either or both of the axes. Like scale and translate, a shear can be done along just one or along both of the coordinate axes. A shear along one axis (say, the x-axis) is performed in terms of the point's coordinate in the other axis (the y-axis). Thus a shear of 1 in the x-axis will cause the x-coodinate of the point ot distort by 1*(y-coordinate). A shear of 0 along either axis will not change the object along that axis.

Specifying a Shear
A shear is specified by a 2-tuple, such as (1, 0) where the first number is the shear along the x-axis, and the second number is the shear along the y-axis.

Undo'ing a Shear
If you have sheared an object by (x,y), and you want to undo this, you need to shear the object again by (-x,-y).

Example
The example below shows a shear of (1,0). This shears the square along the x-axis by a factor of 1, and no shearing along the y-axis. The second shearing reverses the first 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 shear is with respect to the origin.

Back Introductory Trail Next


Index Advanced Trail Programmer's Trail Game