Transformation

   


    The process which is used to transform an object in terms of co-ordinate positions or its size is called as transformation. Transformation of an object can be viewed by two ways :
    
                        1. Co-ordinate transformation
                        2. Geometric transformation

Co-ordinate transformation :  If the object is held at rest i.e stationary and its co-ordinate positions ( x or y or z axis) is transferred relative to an object , then the transformation is called as co-ordinate transformation .

Geometric transformation : If the co-ordinate positions are not changed and the object is transformed relative to the co-ordinate then the transformation is called as geometric transformation .

Some of the transformation types are :
   
              1. Translation
              2. Rotation
              3. Scaling
              4. Reflection
              5. Shearing

Translation : Moving the object from one co-ordinate position to another co-ordinate position without affecting the size and shape of an object is called as translation .
Let the original position be p(x,y) and the new co-ordinate position be p'(x',y') ,then
                   x'=x+t x and y'=y+t y 
where (t x,t y) are the translation distances .

2d Rotation : The object is repositioned along the circular path in the xy plane and every pixel on the object is rotated through the same angle . 
Let the original position be p(x,y) and the new co-ordinate position be p'(x',y').
Where    Θ  is the rotation angle and Φ is the original angular position and
               (x r,y r) is the pivot point.

2d rotation with respect to origin :
                x' = x cosΘ - y sinΘ
                y' = y cosΘ + x sinΘ

For 2d rotation at pivot point :
                x'=x r+cosΘ(x-x r)-sinΘ(y-y r)
                y'=y r+sinΘ(x-x r)+cosΘ(y-y r

Scaling : Scaling refers to changing the size of an object .(s x,s y) are the scaling factor .
Where s x = scales the object along x direction and
           s y = scales the object along y direction . 

case 1 : If the scaling factor is less than 1 ,then the size of the object is reduced and the object moves closer to the origin.
case 2 If the scaling factor is greater than 1 ,then the size of the object is enlarges and the object moves away from the origin.

Scaling with respect to origin :
              x'=x.s x
              y'=y.s y    
Scaling with respect to pivot point :
             x' = s x (x-x r)+x r
             y' = s y (y-y r)+y r   

Reflection : Producing a mirror image of an object is called as reflection. A mirror image of 2d reflection can be generated by rotating the object about 180 degree about the reflection axis relative to the axis of reflection.Some of the types of reflection are :
            1. Reflection about x axis
            2. Reflection about y axis
            3. Reflection through y = x axis
            4. Reflection through y = -x axis
            5. Reflection through perpendicular to xy plane
            6. Reflection about the line y=mx + c

   Reflection about x axis : Which keeps x value and flips the y value i.e x'=x and y' = -y.
   Reflection about y axis : Which keeps y value and flips the x value i.e x' = -x and y'=y.
   Reflection through y = x axis : x'=y and y'=x.
   Reflection through y = -x axis : x' = -y and y' = -x.
   Reflection through perpendicular to xy plane : x' = -x and y' = -y.

Shearing : Shearing refers to distorting the shape of an object i.e the original shape of an object changes after shearing.Some of the types of shearing are :
          1. x direction shearing with respect to x line
          2. x direction shearing with respect to y line
          3. y direction shearing with respect to y line
          4. y direction shearing with respect to x line
          5. Shearing along both the directions




 

 
   


Previous
Next Post »