120 likes | 286 Views
Geometric Transformations. Geometric Transformations. Translate X’ = X + dx Y’ = Y + dy X’ = X + (-6) Y’ = Y + (-4). dy. dx. Geometric Transformations. Scale X’ = X * S x Y’ = Y * S y X’ = X * 2 Y’ = Y * 0.5 Only origin is stable. Geometric Transformations. Scale X’ = X * S x
E N D
Geometric Transformations • Translate • X’ = X + dx • Y’ = Y + dy • X’ = X + (-6) • Y’ = Y + (-4) dy 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 = [X’ Y’ 1] b e 0 c f 1 a b c * X = X’ d e f Y Y’ 0 0 1 1 1
Matrix form 1 0 dx * X = X’ 0 1 dy Y Y’ 0 0 1 1 1 T(dx,dy) S(Sx, Sy) R(a) R(sin(a),cos(a)) Sx 0 0 * X = X’ 0 Sy 0 Y Y’ 0 0 1 1 1 cos(a) -sin(a) 0 * X = X’ sin(a) cos(a) 0 Y Y’ 0 0 1 1 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 X Y 1 X’ Y’ 1 1 0 -2 0 1 -2 0 0 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 X Y 1 X’ Y’ 1 1 0 -2 0 1 -2 0 0 1 =
R(45) S(2,1) S(2,1) R(45)