Professional Documents
Culture Documents
ch5 1
ch5 1
• Translation
Straight line movement
• Rotation
Circular movement w.r.t pivot
• Scaling
Change of size
Translation
Y 6
4
4, 4
tx = 2 3
ty = 3
2
1
2, 1
0
1 2 3 4 5 6 7 8 9 10
X
Translation
• Translation Distances tx, ty
• For point P(x,y) after translation we have P′(x′,y′)
x′ = x + tx
y′ = y + ty
Y
6
5
Ɵ = π/6
4
1 Ɵ
0
1 2 3 4 5 6 7 8 9 10
X
Rotation
• Repositions an object along a circular path in xy-
plane
• Rotation Angle θ
• Rotation Point (xr, yr)
• θ is +ve counterclockwise rotation
• θ is -ve clockwise rotation
• θ is zero ?
Rotation
• For simplicity, consider the pivot at origin and
rotate point P (x,y)
where x = r cosФ and y = r sinФ
• If rotated by θ then:
• x′ = r cos(Ф + θ)
= r cosФ cosθ – r sinФ sinθ
and
• y′ = r sin(Ф + θ)
= r cosФ sinθ + r sinФ cosθ
Rotation
• Replacing r cosФ with x and r sinФ with y, we
have:
x′ = x cosθ – y sinθ
y′ = x sinθ + y cosθ
Rotation
• Column vector representation:
P′ = R . P
Where
Y 6
Sx = 3 3
Sy = 2
2
2 3
1 1 1 6 9
2 2
0
1 2 3 4 5 6 7 8 9 10
X
Scaling
• Scaling alters the size of an object
• Scaling factors Sx and Sy are used
• For polygons, coordinates of each vertex may be
multiplied by Sx & Sy to produce the transformed
coordinates:
x′ = x.Sx y′ = y.Sy
Scaling
• In matrix form it can be expressed as :
P′ = S.P
x' Sx 0 x
y ' 0 Sy . y
Scaling
• Scaling factor > 1
• Scaling factor < 1
• Scaling factor = 1
• Rotation:
P′ = R . P
• Scaling:
P′ = S . P
Homogeneous Coordinates
P’ = M1 . P + M2
Reflection
Y
6
5
4
4
3
2
1
0
1 2 3 4 5 6 7 8 9 10 X
Shear
x direction Shear
• x’ = x + shx . y
• y’ = y
y direction Shear
• x’ = x
• y’ = shy . x + y
Shear
• x’ = x + shx . y
• y’ = shy . x + y