### Geometric Transformationsx

```Geometric Transformations
Geometric Transformations
• Translate
– X’ = X + dx
– Y’ = Y + dy
dy
– X’ = X + (-6)
– Y’ = Y + (-4)
dx
Geometric Transformations
• Scale
– X’ = X * Sx
– Y’ = Y * Sy
– X’ = X * 2
– Y’ = Y * 0.5
• Only origin is stable
Geometric Transformations
• Scale
– X’ = X * Sx
– Y’ = Y * Sy
– X’ = X * -1
– Y’ = Y * 1
• Only origin is stable
Geometric Transformations
• Rotate
– X’ = cos(a)X – sin(a)Y
– Y’ = sin(a)X + cos(a)Y
– X’ = cos(45)X – sin(45) Y
– Y’ = sin(45)X + cos(45)Y
• Only origin is stable
General Form
• Translate
– X’ = 0 * X + 0 * Y + dx
– Y’ = 0 * X + 0 * Y + dy
• Scale
– X’ = Sx * X + 0 * Y + 0
– Y’ = 0 * X + Sy * Y + 0
• Rotate
– X’ = cos(a)*X – sin(a)*Y + 0
– Y’ = sin(a)*X + cos(a)*Y + 0
Homogenous Coordinates
• Translate
– X’ = 1 * X + 0 * Y + dx = [1, 0, dx] * [ X, Y, 1]
– Y’ = 0 * X + 1 * Y + dy = [0, 1, dy] * [ X, Y, 1]
• Scale
– X’ = Sx * X + 0 * Y + 0 = [Sx, 0, 0] * [ X, Y, 1]
– Y’ = 0 * X + Sy * Y + 0 = [0, Sy, 0] * [ X, Y, 1]
• Rotate
– X’ = cos(a)*X – sin(a)*Y + 0
= [cos(a), -sin(a), 0] * [ X, Y, 1]
– Y’ = sin(a)*X + cos(a)*Y + 0
= [sin(a), cos(a), 0] * [ X, Y, 1]
Matrix form
[ X Y 1] * a d 0
b e 0
c f 1
a b c
d e f
0 0 1
*
= [X’ Y’ 1]
X
Y
1
=
X’
Y’
1
Matrix form
*
X
Y
1
=
T(dx,dy)
1 0 dx
0 1 dy
0 0 1
X’
Y’
1
*
X
Y
1
=
S(Sx, Sy)
Sx 0 0
0 Sy 0
0 0 1
X’
Y’
1
cos(a) -sin(a) 0 *
R(a)
sin(a) cos(a) 0
R(sin(a),cos(a))
0
0
1
X
Y
1
=
X’
Y’
1
T(2, 2) S(3/4, 1/3) T(-2,-2)
1 0 2
0 1 2
0 0 1
3/4 0 0
0 1/3 0
0 0 1
1 0 -2
0 1 -2
0 0 1
X
Y
1
=
X’
Y’
1
T(2, 2) S(3/4, 1/3) T(-2,-2)
1 0 2
0 1 2
0 0 1
3/4 0 0
0 1/3 0
0 0 1
1 0 -2
0 1 -2
0 0 1
X
Y
1
=
X’
Y’
1
R(45) S(2,1)
S(2,1) R(45)
```