Professional Documents
Culture Documents
Transformations
Geometric Transformations
Basic transformations:
Translation
Scaling
Rotation
Purposes:
To move the position of objects
To alter the shape / size of objects
To change the orientation of objects
Homogeneous Coordinates
A point (x,y) can be re-written in homogeneous
coordinates as (xh, yh, h)
The homogeneous parameter h is a non-zero value
such that:
xh yh
x y
h h
Combine the geometric transformation into a single matrix with 3by3 matrices
Expand each 2D coordinate to 3D coordinate with homogenous parameter
Two-Dimensional translation matrix
x' 1 0 t x x
y '
0 1 t y y
1 0 0 1 1
Two-Dimensional rotation matrix
x' cos cos 0 x
y' sin cos 0 y
1 0 0 1 1
x cos sin 0 x
y sin cos 0 y
1 0 0 1 1
Rotate
Matrix Concatenation Properties
Associative properties
A B C A (B C ) ( A B ) C
Composite transformation
A sequence of transformations
Calculate composite transformation matrix rather
than applying individual transformations
P' M2 M1 P
P' M P
Composite two-dimensional translations
Apply two successive translations, T1 and T2
T1 T (t1x , t1 y )
T2 T (t 2 x , t2 y )
P' T2 (T1 P) (T2 T1 ) P
Composite transformation matrix in coordinate form
T( t 2 x , t 2 y ) T( t 1x , t 1y ) T( t 1x t 2 x , t 1y t 2 y )
Two-dimensional composite transformation (2)
T x f , y f S s x , s y T x f , y f S x f , y f , s x , s y
1 0 xf s x 0 0 1 0 x f s x 0 x f (1 s x )
0 1 yf 0 sy 0 0 1 y f 0 sy y f (1 s y )
0 0 1 0 0 1 0 0 1 0 0 1
Two-dimensional composite transformation (7)
s2
General Scaling Directions
Converted to a parallelogram
y y
(1/2,3/2) (2,2)
(0,1) (1,1)
(3/2,1/2)
(0,0) (1,0) x (0,0) x
Scale
s1 cos 2 s2 sin 2 ( s2 s1 ) cos sin 0 y s2
R 1 ( ) S ( s1 , s2 ) R( ) ( s2 s1 ) cos sin s1 sin 2 s2 cos 2 0
0 0 1 xs
1