Professional Documents
Culture Documents
A transformation is any operation on a point in space (x, y) that maps the point's
coordinates into a new set of coordinates (x1,y1).
There are 4 main types of transformations that one can perform in 2 dimensions:
1. translations
2. scaling
3. rotation
4. shearing
Translation
In translation an object is displaced a given distance and direction from its original
position. If the displacement is given by the vector v = txI + tyJ, the new object point P'(x',
y') can be found by applying the transformation Tv to P(x, y). See the figure below
P' = Tv(P)
As an example, consider a triangle defined by three vertices (20,0), (60, 0), and (40, 100)
being translated 100 units to the right along the x-axis ( tx = 100) and 10 units up along the
y-axis (ty = 10). The new vertices are (120, 10), (160, 10), and (140, 110), see figure below:
Rotation
In rotation, the object is rotated about the origin. The convention is that the direction
of the rotation is CCW if is a positive angle and CW if the is a negative angle. The
transformation for rotation R is
P' = R(P)
For example a triangle (20,0), (60,0), (40,100) rotated 45 clockwise about the origin is
(14.14, -14.14), (42.43, -42.43), (98.99, -42.43)
Scaling
If Sx and Sy are not equal, they have the effect of distorting pictures by elongating or
shrinking them along the directions parallel to the coordinate axes. The mirror image of
an object can be generated by using the negative values for Sx and Sy.
Homogeneous Coordinates
A shear is a transformation that distorts the shape of an object along either or both of the
axies. 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).
x1 = x + ay
y1 = y
Where b = 0
Where x1 and y1 are the new values, x and y are the original values, and a is the scaling
factor in the x direction. The matrix is as follows.
Shearing in the y direction is similar except the roles are reversed.
x1 = x
y1 = y + bx
Where a = 0.
Where x1 and y1 are the new values, x and y are the original values, and b is the scaling
factor in the y direction. The matrix is as follows.
Example
Composition
Translate P1 to origin
Rotate