# Transformations

Views:

Category: Education

Transformations

## Presentation Transcript

### 2D Transformations:

2D Transformations

### Geometric Transformations:

Geometric Transformations Changes in orientation, size and shape are accomplished with geometric transformations that alter the coordinate descriptions of objects.

### PowerPoint Presentation:

Three types of transformations Translation Rotation Scaling Other two are Reflection shear

### Translation :

Translation A translation is applied to an object by repositioning it along a straight-line path from one coordinate location to another. We translate a two-dimensional point by adding translation distances, t x and t y to the original coordinate position (x, y) to move the point to a new position (x', y').

### PowerPoint Presentation:

T P P' Translating a point from position P to position P‘ with translation vector T

### PowerPoint Presentation:

x‘= x+ t x y‘= y+ t y The translation distance pair ( t x and t y ) is called a translation vector or shift vector.

### PowerPoint Presentation:

Translation Matrix

### PowerPoint Presentation:

x a ,y a x b , y b X a +t x, y a +t y X b +t x, y b +t y Translating a straight line Translating a polygon x 1 ,y 1 x 2 ,y 2 x 3 ,y 3 X 1 +t x, y 1 +t y X 2 +t x, y 2 +t y X 3 +t x, y 3 +t y

### PowerPoint Presentation:

Translating a circle or ellipse X c ,y c r r X c +t x, y c +t y

### For homogeneous coordinates:

For homogeneous coordinates Represent each Cartesian coordinate position (x, y) with the homogeneous coordinate triple( x, y, h). For 2D transformations we can choose h as a nonzero value. A convenient choice is 1.

### Abbreviated form is P’ = T(tx , ty) . P:

Abbreviated form is P’ = T(t x , t y ) . P

### Rotation:

Rotation A 2D rotation is applied to an object by repositioning it along a circular path in the xy plane. To generate a rotation, we specify a rotation angle Ѳ and the position (x r , y r ) of the rotation point or pivot point about which the object is to be rotated.

Ѳ P' P y r Xr

### PowerPoint Presentation:

Mainly 2 cases of rotation Anticlockwise About origin About arbitrary point Clockwise About origin About arbitrary point

### Rotation about origin:

Rotation about origin Anticlockwise direction r is the constant distance of the point from the origin, angle Ø is the original angular position of the point from the horizontal, and Ѳ is the rotation angle. y X’ , y' X , y r r Ѳ Ø Rotation of a point P to P’ through an angle Ѳ w. r. t. the origin. x y Y ' x '

### PowerPoint Presentation:

The transformed coordinates in terms of angles Ѳ and Ø as Sin Ø = opposite / hypotenuse = y/r Y= r. Sin Ø Cos Ø = adjacent / hypotenuse = x / r X= r. Cos Ø 1 2

### PowerPoint Presentation:

cos ( Ѳ +Ø) = X’ /r X’ = r.cos( Ѳ +Ø) X’ = r.[Cos Ѳ Cos Ø – Sin Ѳ Sin Ø] X’ = r. Cos Ѳ Cos Ø – r. Sin Ѳ Sin Ø substitute eqns 1 & 2 in eqn 3 X’= x. Cos Ѳ - y . sin Ѳ 3 A //Cos( a+b )= cosa cosb – sina sinb

### PowerPoint Presentation:

Sin ( Ѳ +Ø) = y’ /r y’ = r.sin( Ѳ +Ø) // sin(A+B)=sin A cos B + cos A sin B y’ = r[Sin Ѳ . Cos Ø +Cos Ѳ . Sin Ø] y’ = r. Sin Ѳ . Cos Ø +r. Cos Ѳ . Sin Ø substitute eqns 1 & 2 in eqn 4 y’= x. Sin Ѳ + y. Cos Ѳ 4 B

### PowerPoint Presentation:

Rotation equation in matrix form is given by P’ = R.P x‘ = cos Ѳ - sin Ѳ * x y Y’ sin Ѳ cos Ѳ

### Homogeneous representation:

Homogeneous representation

### Rotation about an arbitrary point:

Rotation about an arbitrary point Anticlockwise direction

### PowerPoint Presentation:

Y-y r Y'-y r x- x r x'-x r

### PowerPoint Presentation:

sin Ø = opp / hyp = y-y r /r y-y r = r.sin Ø Cos Ø = adj / hyp = x- x r / r x- x r = r. Cos Ø 1 2

### PowerPoint Presentation:

Cos ( Ѳ +Ø) = X’- x r /r X’- x r = r.cos( Ѳ + Ø) // cos(A+B)= cos A cos B - sin A sin B X’- x r = r.[Cos Ѳ Cos Ø –Sin Ѳ Sin Ø] X’- x r = r . Cos Ѳ Cos Ø –r. Sin Ѳ Sin Ø substitute equations 1 & 2 in equation 3 X’- x r = ( X- x r) . Cos Ѳ - (y-y r.) sin Ѳ X’= x r + ( X- x r) Cos Ѳ - (y-y r.) sin Ѳ 3 A

### PowerPoint Presentation:

sin ( Ѳ +Ø) = y’- y r /r y’- y r = r. Sin( Ѳ +Ø) // sin(A+B)=sin A cos B + cos A sin B y’- y r = r.[Sin Ѳ . Cos Ø + Cos Ѳ . Sin Ø] y’- y r = r Sin Ѳ . Cos Ø + r. Cos Ѳ . Sin Ø substitute equations 1 & 2 in equation 4 y’- y r = (x- x r .) Sin Ѳ + (y-y r.) . Cos Ѳ y’= y r + (x- x r .) Sin Ѳ + (y-y r.) . Cos Ѳ 4 B

### Rotation about origin:

Rotation about origin Clockwise direction P P' y' y r r Ø Ѳ Ø - Ѳ x x'

### PowerPoint Presentation:

sin Ø = opp / hyp = y/r Y= r.sin Ø Cos Ø = adj / hyp = x / r X= r. Cos Ø 1 2

### PowerPoint Presentation:

Cos ( Ѳ - Ø) = X’ /r X’ = r.cos( Ѳ - Ø) // cos(A-B)= cos A cos B + sin A sin B X’ = r.[Cos Ѳ Cos Ø + Sin Ѳ Sin Ø ] X’ = r . Cos Ѳ Cos Ø + r. Sin Ѳ Sin Ø substitute eqns 1 & 2 in eqn 3 X’= x. Cos Ѳ + y . sin Ѳ 3 A

### PowerPoint Presentation:

sin ( Ѳ - Ø) = y’ /r y’ = r.sin( Ѳ - Ø) // sin(A-B)=sin A cos B - cos A sin B y’ = r[Sin Ѳ Cos Ø - Cos Ѳ Sin Ø] y’ = r. Sin Ѳ Cos Ø - r. Cos Ѳ Sin Ø substitute eqns 1 & 2 in eqn 4 y’= x. sin Ѳ - y. Cos Ѳ 4 B

### Rotation about an arbitrary point :

Rotation about an arbitrary point Clockwise direction P P' X r, y r Ø Ѳ Ѳ - Ø Y-y r Y'-y r X- x r X'- x r

### PowerPoint Presentation:

sin Ø = opp / hyp = y-y r /r y-y r = r.sin Ø Cos Ø = adj / hyp = x- x r / r x- x r = r. Cos Ø 1 2

### PowerPoint Presentation:

Cos ( Ѳ - Ø) = X’- x r /r X’- x r = r. Cos( Ѳ - Ø) // cos (A-B)= cos A cos B + sin A sin B X’- x r = r[Cos Ѳ Cos Ø + Sin Ѳ . Sin Ø ] X’- x r = r. Cos Ѳ Cos Ø + r. Sin Ѳ . Sin Ø substitute equations 1 & 2 in equation 3 X’- x r = ( X- x r) . Cos Ѳ + (y-y r.) sin Ѳ X’= x r + ( X- x r) Cos Ѳ + (y-y r.) sin Ѳ 3 A

### PowerPoint Presentation:

sin ( Ѳ -Ø) = y’- y r /r y’- y r = r.sin( Ѳ -Ø) // sin(A-B)=sin A cos B - cos A sin B y’- y r = r.[Sin Ѳ Cos Ø – Cos Ѳ Sin Ø] y’- y r = r. Sin Ѳ Cos Ø – r. Cos Ѳ Sin Ø substitute equations 1 & 2 in equation 4 y’- y r = (x-x r.) sin Ѳ - (y-y r.) . Cos Ѳ y’= y r + (x- x r .) sin Ѳ - (y-y r.) . Cos Ѳ 4 B

### scaling:

scaling Scaling alters the size of an object. This operation can be carried out for polygons by multiplying the coordinate values (x, y) of each vertex by scaling factors s x , s y to produce the transformed coordinates(x' ,y' ). x' = x. s x y' = y. s y

### PowerPoint Presentation:

Scaling factor s x scales objects in the x direction, while s y scales in the y direction.

### In matrix form we can write it as :

In matrix form we can write it as

### Homogeneous representation:

Homogeneous representation

### Reflection:

Reflection It is a transformation that produces the mirror image of an object. The mirror image for a two dimensional reflection by rotating the object 180° about the reflection axis. Axis of reflection is in x y plane or perpendicular to the x y plane.

### PowerPoint Presentation:

When the reflection axis is a line in the x y plane, the rotation path about this axis is in a plane perpendicular to the x y plane. For reflection axes that are perpendicular to the x y plane , the rotation path is in the x y plane.

### Reflection about X axis:

Reflection about X axis X’ = X Y’ = -Y

### PowerPoint Presentation:

E. g A = (2,3) B= (1,1) C= (3,1) A‘ = (2,-3) B‘ = (1,-1) C‘ = (3,-1)

### Reflection about Y axis:

Reflection about Y axis X’ = -X Y’ = Y

### PowerPoint Presentation:

E. g A = (2,3) B= (1,1) C= (3,1) A‘ = (-2,3) B‘ = (-1,1) C‘ = (-3,1)

### Reflection about X Y plane:

Reflection about X Y plane 1 3 2 1 3 2 2 3 1

### Reflection of an object relative to an axis perpendicular to the x y plane and passes through the origin:

Reflection of an object relative to an axis perpendicular to the x y plane and passes through the origin X’ = - X Y’ = -Y

### PowerPoint Presentation:

E. g A = (1,1) B= (3,3) C= (3,1) A‘ = (-1,-1) B‘ = (-3,-3) C‘ = (-3,-1)

### Reflection of an object w. r. t the line y=x:

Reflection of an object w. r. t the line y=x X‘ = X Cos Ѳ + Y Sin Ѳ Y‘ = Y Cos Ѳ - X Sin Ѳ

### steps:

steps Rotation through an angle 45° in the clockwise direction. Reflection about X- axis. Perform anticlockwise rotation X‘ = Y Y‘ = X

### PowerPoint Presentation:

E.g A=(3,4) B= (2,6) C=(1,5) A’ = (4,3) B’ =(6,2) C’ =(5,1)

### Reflection of an object w. r. t the line y= -x:

Reflection of an object w. r. t the line y= -x A B C B' C' A'

### steps:

steps Rotate through an angle 45° in clockwise direction. Reflection about Y-axis. Perform anticlockwise direction. X‘ = -Y Y‘ = -X

### PowerPoint Presentation:

E.g A=(-3,4) B= (-1,5) C=(-2,6) A’ = (-4,3) B’ = (-5,1) C’ = (-6,2)

### Reflection about any line y= m x + b:

Reflection about any line y= m x + b It is accomplished with a combination of translation- rotate- reflect- rotate transformation. Steps Translate Rotate 45° (+ Ѳ ) Reflection about x- axis Rotate -45 ° (- Ѳ )

### Reflection about an axis perpendicular to xy plane and passes to an arbitrary point :

Reflection about an axis perpendicular to xy plane and passes to an arbitrary point X’ = -X + 2x p Y’ = -Y + 2Y p

### PowerPoint Presentation:

E.g. A=(3,3) B=(1,3) C=(2,2) ( X p , Y p ) = (4,4) A'=(5,5) B'=(7,5) C'=(6,6)

### Shear:

Shear A transformation that distorts the shape of an object. Two types X- shear – that shift x coordinate values. Y- shear - that shift y coordinate values

### X- shear:

X- shear X’ = x+ sh x . Y Y’ = Y

Matrix form

### PowerPoint Presentation:

e.g. sh x = 2 A(0,0)= A’ (0,0) B(1,0)= B’ (1,0) C (1,1) = C’ (3,1) D(0,1) = D’ (2,1)

E.g.

### For homogeneous coordinates:

For homogeneous coordinates x‘ 1 shx 0 x y’ = 0 1 0 y 1 0 0 1 1

### Y- shear:

Y- shear X’ = X Y’ = Y+ sh y . X Matrix Form X’ = 1 0 X Y’ sh y 1 Y

### PowerPoint Presentation:

e.g. sh y = 2 A(0,0)= A’ (0,0) B(1,0)= B’ (1,2) C (1,1) = C’ (1,3) D(0,1) = D’ (0,1)

### For homogeneous coordinates:

For homogeneous coordinates x‘ 1 0 0 x y’ = sh y 1 0 y 1 0 0 1 1

### X- shear relative to any other reference line:

X- shear relative to any other reference line X’ = X + y sh x - sh x y ref X’ = X + sh x ( Y- y ref ) Y ’ = Y Matrix Form X ’ = 1 sh x -sh x y ref X Y ’ 0 1 0 Y 1 0 0 1 1

### PowerPoint Presentation:

E.g. when sh x = ½ and y ref = -1 At A (0,0) X’ = 0.5 Y ’ =0 A ’ =(0.5,0) At B(1,0) X’ = 1.5 Y ’ =0 B ’ =(1.5,0) At C(1,1) X’ = 2 Y ’ =1 C ’ =(2,1) At D(0,1) X’ = 1 Y ’ =1 D ’ =(1,1)

### Y- shear relative to any other reference line:

Y- shear relative to any other reference line X’ = X Y ’ = sh y . X + Y- sh y X ref Y ’ = Y+ sh y ( X- X ref ) Matrix Form X ’ = 1 0 0 X Y ’ sh y 1 - sh y X ref Y 1 0 0 1 1

### PowerPoint Presentation:

E.g. when sh y = ½ and x ref = -1 At A (0,0) X’ = 0 Y ’ =1/2 A ’ =(0 , 1/2) At B(1,0) X’ = 1 Y ’ =1 B ’ =(1,1) At C(1,1) X’ = 1 Y ’ =2 C ’ =(1,2) At D(0,1) X’ = 0 Y ’ =3/2 D ’ =(0,3/2) 