





































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!






































x y x y x y
Position (translation) Size (scaling) Orientation (rotation) Shapes (shear)
The new point: (x’, y’) x’ = x + tx y’ = y + ty (^) (x,y) (x’,y’) OR P’ = P + T where P’ = x’ p = x T = tx y’ y ty tx ty
x’ = x + tx y’ y ty Use 3 x 1 vector x’ 1 0 tx x y’ = 0 1 ty * y 1 0 0 1 1
θ θ> 0 : Rotate counter clockwise θ< 0 : Rotate clockwise θ
(x,y) (x’,y’) θ (x,y) -> Rotate about the origin by θ (x’, y’) How to compute (x’, y’)? φ x = r cos (φ) y = r sin (φ) r x’ = r cos (φ + θ) y = r sin (φ + θ)
(x,y) (x’,y’) θ φ r x’ = x cos(θ) – y sin(θ) y’ = y cos(θ) + x sin(θ) Matrix form? x’ cos(θ) -sin(θ) x y’ sin(θ) cos(θ) y = 3 x 3?
x’ cos(θ) -sin(θ) x y’ sin(θ) cos(θ) y = (x,y) (x’,y’) θ φ r x’ cos(θ) -sin(θ) 0 x y’ sin(θ) cos(θ) 0 y 1 0 0 1 1 =
Scale: Alter the size of an object by a scaling factor (Sx, Sy), i.e. x’ = x. Sx y’ = y. Sy x’ Sx 0 x y’ 0 Sy y
(1,1) (2,2) Sx = 2, Sy = 2 (2,2) (4,4)
(1,1) (2,2) Sx = 2, Sy = 2 (2,2) (4,4) Not only the object size is changed, it also moved!! Usually this is an undesirable effect We will discuss later (soon) how to fix it
Translation: x’ x tx y’ y ty Rotation: x’ cos(θ) -sin(θ) x y’ sin(θ) cos(θ) y Scaling: x’ Sx 0 x y’ 0 Sy y = + = * = *
Or, 3x3 Matrix representations Translation: Rotation: Scaling: Why use 3x3 matrices? x’ 1 0 tx x y’ = 0 1 ty * y 1 0 0 1 1 x’ cos(θ) -sin(θ) 0 x y’ sin(θ) cos(θ) 0 * y 1 0 0 1 1 = x’ Sx 0 0 x y’ = 0 Sy 0 * y 1 0 0 1 1
cos(θ) -sin(θ) 0 sin(θ) cos(θ) 0 0 0 1
Translate the object so that P will coincide with the origin: T(-px, -py) Rotate the object: R(θ) Translate the object back: T(px,py) (px,py)