Professional Documents
Culture Documents
2D TRANSFORMATIONS
2D Transformations
• Rotation
• Scaling
• Uniform Scaling
• Un-uniform Scaling
• Reflection
• Shear
Translation
• A translation moves all points
in an object along the same
straight-line path to new
positions.
• The path is represented by a P'(8,6)
vector, called the translation or
shift vector.
• We can write the components: ty=4
p'x = px + tx
p'y = py + ty P(2, 2) tx = 6
• or in matrix form:
P' = P + T
x' x tx
y' = y + ty
Rotation
• A rotation repositions
all points in an object
along a circular path in P
the plane centered at
the pivot point.
P’(x’, y’)
• or in matrix form:
P' = R • P
can be clockwise (-ve) or
counterclockwise (+ve as our
example). y’
P(x,y)
• Rotation matrix
r
cos sin y
R
sin cos x’ x
Scaling
• Scaling changes the size of an
object and involves two scale
factors, Sx and Sy for the x-
P’
and y- coordinates
respectively.
• Scales are about the origin.
• We can write the components:
p'x = sx • px P
p'y = sy • py
or in matrix form:
P' = S • P
Scale matrix as:
sx 0
S
0 s y
Scaling
• Example :
•P(2, 5), Sx = 0.5, Sy = 0.5
•
Scaling
If the scale factors are in between
0 and 1 the points will be moved
P’
closer to the origin the object
will be smaller.
• Example :
•P(2, 5), Sx = 0.5, Sy = 0.5
P(2, 5)
(xf,yf)
(a) (b)
Translation of (c) (d)
Original
Position of object so that scaling was Translation of the
Object and fixed point about origin object so that the
Fixed point (xf,yf)is at Fixed point is returned
origin to position (xf,yf)
Other transformations
• Reflection is a transformation that produces a mirror image of
an object. It is obtained by rotating the object by 180 deg about
the reflection axis
1 0 0
2 3
2’ 3’ 0 -1 0
0 0 1
1’
Reflected position
Reflection
-1 0 0
0 1 0
0 0 1
Reflection
-1 0 0
Reflected position
0 -1 0
3’
0 0 1
2’
1’
Reflection of an object relative to
1 an axis perpendicular to the
2 xy plane and passing through
the coordinate origin
3
Original position
Reflection of an object w.r.t the
line y=x
0 1 0
Original position 1 0 0
3
0 0 1
2 1
1’
3’
Reflected position
2’
Shear Transformations
1 0 0 1 shx 0
shy 1 0 0 1 0
0 0 1 0 0 1
An X- direction Shear
For example, Shx=2
(2,1) (3,1)
(0,1) (1,1)
Y Y (1,3)
(1,2)
X X
(0,0) (1,0) (0,0)