3.1 2D-Transformaton

Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

UNIT 3 1

MODULE – 3 : 2D TRANSFORMATIONS
Changes in orientation, size, and shape are accomplished with geometric
transformations that alter the coordinate descriptions of objects. The basic geometric
transformations are:
➢ Translation,
➢ Rotation,
➢ Scaling.
Other transformations that are often applied to objects include:
➢ Reflection
➢ Shear.

1. TRANSLATION
• A translation is applied to an object by repositioning it along a straight-line path
from one coordinate location to another.
• A two-dimensional point translated by adding translation distances, tx, and ty,
to the original coordinate position (x, y) to move the point to a new position
( x ' , y').

These equations are known as translation equations and translation distance


pair (tx , ty) is called a translation vector or shift vector.

Matrix representation

• Translation is a rigid-body transformation that moves objects without


deformation. ie, every point on the object is translated by the same amount.
UNIT 3 2

• A straight Line segment is translated by applying the transformation equation to


each of the line endpoints and redrawing the line between the new endpoint
positions.To change the position of a circle or ellipse, we translate the center
coordinates and redraw the figure in the new location.

2. ROTATION
• A two-dimensional 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 (xr, yr) of
the rotation point (or pivot point) about which the object is to be rotated .

Fig: Rotation of an object through angle


about the pivot point (xr, yr)

• Positive values for the rotation angle define counterclockwise rotations about
the pivot point, as in above, and negative values rotate objects in the clockwise
direction.
UNIT 3 3

We first determine the transformation equations for rotation of a point position


P when the pivot point is at the coordinate origin. The angular and coordinate
relationships of the original and transformed point positions are shown in the belw fig.

fig: Rotalion of a point from position (x, y) to


position (x', y ') through an angle relative
to the coordinate origin. The original angular
displacement of the point from the x axis is .

In this figure, ‘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.

Using standard trigonometric identities, we can express the transformed coordinates in


terms of angles and as :

The original coordinates of the point in polar coordinates are:

Substituting the above expressions , we obtain the transformation equations for


rotating a point at position (x, y) through an angle about the origin:

we can write the rotation equations in the matrix form:


P’ = R.P
UNIT 3 4

where the rotation matrix is:

Rotation of an object about pivot point

Fig: Rotating a point from position (x, y) to position ( x ' ,y ' ) through an angle
about rotation point ( xr , yr ).

➢ Rotations are rigid body transformations that move objects without


deformation.Every point on an object is rotated through the same angle.

3. SCALING
A scaling transformation 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 Sx, and Sy, to produce the transformed coordinates (x', y'):

The transformation equations for scaling are:


x' = x. Sx
y' = y. Sy
UNIT 3 5

• Scaling factor Sx, scales objects in the ‘x’ direction, while Sy scales in the ‘y’
direction.

In matrix form the equations are:

Ie, P’ = S.P , where ‘S’ is the 2x2 matrix

• Any positive numeric values can be assigned to the scaling factors Sx, and Sy.
Values less than 1 reduce the size of objects; values greater than 1 produce an
enlargement.

There are 2 types of Scaling


1.Uniform scaling
2.Differential Scaling

When Sx, and Sy, are assigned the same value, a uniform scaling is produced
that maintains relative object proportions. Unequal values for Sx, and Sy, result in a
differential scaling.

OTHER TRANSFORMATIONS

4. REFLECTION
Reflection is the mirror image of original object. The mirror image for a two-
dimensional reflection is generated relative to an axis of reflection by rotating the
object 1800 about the reflection axis.

X – axis Reflection
Reflections about the line y=0,the x – axis ,is accomplished with the
transformation matrix:
UNIT 3 6

Y – axis Reflection
A reflections about the y - axis ,flips ‘x’ co ordinate while keeping ‘y’ co
ordinate the same .The transformation matrix is:

About origin
The reflection relative to the coordinate origin, has the matrix representation :

2. Shear
A transformation that distorts the shape of an object such that the transformed
shape appears as if the object were composed of internal layers that had been caused
to slide over each other is called a Shear.

There are two shear transformations X-Shear and Y-Shear. One shifts X
coordinates values and other shifts Y coordinate values.
UNIT 3 7

X-Shear

The X-Shear preserves the Y coordinate and changes are made to X


coordinates, which causes the vertical lines to tilt right or left as shown in below
figure.

An x-direction shear relative to the x axis is produced with the transformation


matrix:

Which transforms coordinate positions as

X’ = x + shx .y and Y’= y

Y-Shear

The Y-Shear preserves the X coordinates and changes the Y coordinates which
causes the horizontal lines to transform into lines which slopes up or down as shown
in the following figure.

You might also like