Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 8

Unit 3 TWO DIMENSIONAL TRANSFORMATIONS

Basic Transformations:

we first discuss general procedures for applying translation, rotation, and


scaling parameters to reposition and resize two-dimensional objects. Then, we
consider how transformation equations can be expressed in a more convenient
matrix formulation that allows efficient combination of object transformations.
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
t
ty
point by adding translation distances, x and
to the original coordinate
position (x, y) to move the point to a new position (x', y')
t
x' = x + x
y' = y +
The translation distance pair (

tx ,

ty
ty

) is called a translation vector or shift

vector.

We can express the translation equations as a single matrix equation by using


column vectors to represent coordinate positions and the translation vector:

This allows us to write the two-dimensional


form:

translation

equations in the matrix

Rotation:
A two dimensional rotation is applied to an object by repositioning it along a
circular path in xy plane. To generate rotation in circular path you needed two

things: rotation angle and position of the rotation point. Based on rotation point
(pivot point): Two types of rotations are possible.
Rotation based on origin
Rotation based on reference point
Rotation based on origin:
First you have to find out the transformation equation for rotation of a point P
when the pivot point is at origin of coordinates.

From the fig: Point is rotating from P(x, y) to P(x, y) based on origin.
Coordinates of the point P in the polar coordinates are:
From the fig: Coordinates of the point P(x, y) in the polar coordinates are:

Apply the x and y value in x and y equation:

Rotation equation in matrix form:


Rotation matrix is:

Rotation based on reference point:


Using the trigonometric relationships in the below fig: we can derive the
transformation equation for rotation based on reference point

Scaling:

This type of transformation is alters the size of an image or object. This


operation is carried out for polygons by multiplying the coordinate value (x, y) of
each vertex by scaling factors Sx and Sy to produce the transformed
coordinates(x, y).
x = x . Sx
y = y . Sy
Matrix form:

Types of scaling:
Uniform Scaling
It produces the relative object proportions by common values
for Sx and Sy
Differential Scaling
It produces the irrelative object proportions by unequal values
for Sx and Sy
Matrix Representation and Homogeneous Coordinates:
Basic transformations can be expressed in the general matrix form:
P = M1 . P + M2
With coordinate positions P and P' represented as column vectors. Matrix M 1 is a 2
by 2 array containing multiplicative factors, and M2 is a two-element column matrix
containing translational terms. For translation M1 is the identity matrix. For rotation
or scaling: M2 contains the translational terms associated with the pivot point or
scaling fixed point. To produce a sequence of transformations with these equations,
such as scaling followed by rotation then translation, we must calculate the
transformed coordinates one step at a time. First, coordinate positions are scaled,
then these scaled coordinates are rotated, and finally the rotated coordinates are
translated. A more efficient approach would be to combine the transformations so
that the final coordinate positions are obtained directly from the initial coordinates,
thereby eliminating the calculation of intermediate coordinate values. To be able to
do this, we need to reformulate the above equation. To eliminate the matrix addition
associated with the translation terms in M2.
We can combine the multiplicative and translational terms for twodimensional geometric transformations in to a single matrix representation by
expanding the 2 by 2 matrix representations to 3 by 3 matrices. This allows us to
express all transformation equations as matrix multiplications, providing
that we also expand the matrix representations for coordinate positions. To express
any two-dimensional transformation as a matrix multiplication, we need three
variable coordinates. So we represent each Cartesian coordinate position (x, y) with
the homogeneous coordinate triple (

xh ,

yh

h), where

y=

yh
h

x=

x h /h

Thus a general homogeneous coordinate representation can also be written as


(h.x, h .y, h). For two-dimensional geometric transformations, we can choose the
homogeneous parameter h to be any nonzero value. A convenient choice is simply
to set h = 1. Each two-dimensional position is represented with homogeneous
coordinates (x, y, 1).
Now we will see the basic transformation using 3 X 3 matrixes.
For Translation:

We can write this in the abbreviated form:


For Rotation:

We can write this in the abbreviated form:


For Scaling:

We can write this in the abbreviated form:

Composite Transformation:
Composite transformation is multiplying the individual transformation in
matrix form. We can set up a matrix: for any sequence of transformations as a
composite transformation matrix by calculating the matrix product of the individual
transformations. Forming products of transformation matrices is often referred to as
a concatenation or composition.
Now we will see how we are going to find the sequence transformation using
composite transformation.
For Translation:
If two successive translation vectors (tx1, ty1) and (tx2, ty2) are applied to the
coordinate position P, the final transformed position is P.
P = T(tx2, ty2) . {T(tx1, ty1) . P}

P = {T(tx2, ty2) . T(tx1, ty1)} . P


P and P are represented as homogeneous coordinate positions.
Matrix form for the equation:
T(tx2, ty2) . T(tx1, ty1)

Or
T(tx2, ty2) . T(tx1, ty1) = T(tx1 + tx2, ty1 + ty2)
From the above matrix and equation: two successive translations are additive
For Rotation:
Similar to translation: Two successive rotations are applied to coordinate
position P and the final transformed position P is

By multiplying two rotation matrix, we can the successive rotation are


additive.
So the final rotated coordinates can be calculated with the composite rotation
matrix as:
For Scaling:
For two successive scaling operations produces the following scaling matrix:

Or
From the above equation: successive scaling operations are multiplicative.
Other Transformation:
Basic Transformations such as Translation, Rotation and Scaling are included
in all graphics packages. But some packages only providing few additional
transformations are:
Reflection and Shear.
Reflection:
Reflection is a transformation that produces a mirror image of an object.
Reflection is generated relative to an axis of reflection by rotating the object 180
about the reflection angle.
1. Reflection of an object about the x axis
This transform it keeps the x value and flips the y values of coordinate
position. Transformation matrix for Reflection about to the x axis is:

2. Reflection of an object about the y axis


This transform it keeps the y value and flips the x values of coordinate
position. Transformation matrix for Reflection about to the y axis is:

3. Reflection of an object relative to an axis perpendicular to the xy plane


This transform it flips the x and y values of coordinate position.
Transformation matrix for Reflection about to the axis perpendicular to the xy
plane:

Shear:
This transformation is distorts the shape of an object. Two common shearing
transformations available:
Shift relative to the x axis direction
Shift in the x axis direction relative to the other reference line
Shift relative to the y axis direction
Shift in the y axis direction relative to the other reference line
Shear in the x axis direction:

This type of shear transformation is generated by only changing the x value of the
coordination of the image. From the above fig: you can understand. Transformation
matrix of shear relative to x axis and x axis direction is given below:

Or
Transformed coordinate position is:
x = x + y . Shx

y = y

Shear in the x axis direction relative to the other reference line:

We can generate x direction shears relative to other reference line(

y ref ):

transformation matrix is:

Or
Transformed coordinate position is:
x = x + Shx (y -

y ref )

y = y

Shear in the y axis direction:


This type of shear transformation is generated by only changing the y value of the
coordination of the image. Transformation matrix of shear relative to y axis and y
axis direction is given below:

Or
Transformed coordinate position is:
x = x

y = y + x . Shy

Shear in the y axis direction relative to the other reference line:


We can generate y direction shears relative to other reference line(
transformation position and matrix are:
x = x

y = y + Sh y (x -

x ref )

x ref ):

You might also like