Two-Dimensional Geometric
    Transformations
Two-Dimensional Geometric
           Transformations

• Basic Transformations
  • Translation
  • Rotation
  • Scaling
• Composite Transformations
• Other transformations
  • Reflection
  • Shear
Translation

•Translation transformation

  •Translation vector or shift vector T = (tx, ty)
•Rigid-body transformation
  •Moves objects without deformation
   y                                     y

                       P’

                T                                    T
          p
                            x                            x
Rotation

Rotation transformation (anticlockwise)
   x’=rcos(θ+Φ)= rcosθcosΦ - rsin θsinΦ
   y’=rsin(θ+Φ)= rcosθsinΦ + rsin θcosΦ   y


        x=rcosΦ y=rsin Φ                              P’ (x’,y’)
  x’=x cosθ - ysinθ
  y’=xsinθ+ycosθ                              θ               P(x,y)
                                                      r
                                                  Φ                    x
    P’= R· P
Rotation

General Pivot point rotation


x’=xr+(x- xr)cosθ - (y- yr)sinθ         y
                                                      P’ (x’,y’)
y’=yr+(x- xr)sinθ+(y- yr)cosθ

                                              θ               P(x,y)
                                                      r
                                                  Φ

                                        (xr,yr)

                                                                   x
Scaling

Scaling transformation




   Scaling factors, sx and sy
         y                         y




                          x             x
Scaling

 Fixed point
Matrix Representations and
           Homogeneous Coordinates

•Homogeneous Coordinates


•Matrix representations
 • Translation
Matrix Representations

 Matrix representations
   Scaling


   Rotation
Composite Transformations

Translations
Composite Transformations

Scaling
Composite Transformations

Rotations
General Pivot-Point Rotation
•Rotations about any selected pivot point (xr,yr)
   •Translate-rotate-translate
General Pivot-Point Rotation
General Fixed-Point Scaling
Scaling with respect to a selected fixed position (x f,yf)
General Fixed-Point Scaling

Translate-scale-translate
Concatenation Properties
Matrix multiplication is associative.
      A·B ·C = (A·B )·C = A·(B ·C)
Transformation products may not be commutative
  Be careful about the order in which the composite matrix is

   evaluated.
  Except for some special cases:

    Two   successive rotations
    Two successive translations

    Two successive scalings

    rotation and uniform scaling
Concatenation Properties

Reversing the order
    A sequence of transformations is performed may affect the
     transformed position of an object.
Reflection

A transformation produces a mirror image of an object.
Axis of reflection
  A line in the xy plane
  A line perpendicular to the xy plane

  The mirror image is obtained by rotating the object 180 0 about the

   reflection axis.
Rotation path
  Axis in xy plane: in a plane perpendicular to the xy plane.
  Axis perpendicular to xy plane: in the xy plane.
Reflection

Reflection about the x axis
Reflection

Reflection about the y axis
Reflection
Reflection relative to the coordinate origin
Reflection
Reflection of an object relative to an axis perpendicular to the xy plane through P rfl
Reflection

Reflection about the line y = x
Shear
The x-direction shear relative to x axis




      If shx = 2:
Shear

The x-direction shear relative to y = yref




 If shx = ½ yref = -1:



                         1            1/2   3/2
Shear

The y-direction shear relative to x = xref




                                    3/2
  If shy = ½ xref = -1:

                                    1/2

                           1

Two dimensional geometric transformations