0% found this document useful (0 votes)
150 views14 pages

2D Transformations

The document discusses different types of 2D geometric transformations: - Translation moves every point of an object by a displacement vector. - Rotation rotates points of an object around the origin by a certain angle. - Scaling enlarges or shrinks an object by a scaling factor. - Reflection mirrors an object across an axis. It also covers coordinate transformations which hold the object stationary while transforming the coordinate system, and describes how to combine transformations through composition of functions.

Uploaded by

sandeepapr
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
150 views14 pages

2D Transformations

The document discusses different types of 2D geometric transformations: - Translation moves every point of an object by a displacement vector. - Rotation rotates points of an object around the origin by a certain angle. - Scaling enlarges or shrinks an object by a scaling factor. - Reflection mirrors an object across an axis. It also covers coordinate transformations which hold the object stationary while transforming the coordinate system, and describes how to combine transformations through composition of functions.

Uploaded by

sandeepapr
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 14

2D

TRANSFORMATIONS
TOPICS:
1. INTRODUCTION
2. GEOMETRIC TRANSFORMATION
 TRANSLATION
 ROTATION ABOUT THE ORIGIN
 SCALING WITH RESPECT TO THE ORIGIN
 MIRROR REFLECTION ABOUT AN AXIS
3. INVERSE GEOMATRIC TRANSFORMATIONS
4. CO-ORDINATE TRANSFORMATIONS
 TRANSLATION
 ROTATION ABOUT THE ORIGIN
 SCALING WITH RESPECT TO ORIGIN
 MIRROR REFLECTION ABOUT AN AXIS
5. INVERESE COORDINATE TRANSFORMATION
6. COMPOSITE TRANFORMATIONS
7. GENERAL PIVOT POINT ROTATION
8. SHEAR TRANSFORMATION
INTRODUCTION

Fundamental to all computer graphics system is the ability to simulate the


manipulation of objects in spare. This simulated spatial manipulation is referred to as
transformation. The need for transformation arises where several objects, each of
which is independently defined in its own co-ordinate system, need to be properly
position into a master co-ordinate system.
There are two complementary points of view of describing object
transformation. The first is that the object itself is transform relative to stationary
coordinate system or background. The mathematical statement of this view point is
described by geometric transformation applied to each point of the object.
The second point of view holds that the object is held stationary while the
coordinate system is transformed related to the object. This effect is attained through
the application of coordinate transformation.
We study for 3 basic transformation:---
1. Translation
2. Rotation
3. Scaling

GEOMATRIC TRANSFORMATION:

Let us impose a coordinate system on a plane. An object qty in the plane can be consider
as a set of points. Every object point P has coordinates (x,y). if the object is moved to a
New position say qty, then its new coordinates P’ can be obtained from the original
points P by the application of the geometric transformation.

Translation:
If the displacement is given by the vector
V=tx I+ty J,
New point P’(x’,y’) can be found by applying transformation Tv to P(x,y)
P’ = Tv(P)
Where
X’=x+tx
Y’=y+ty

Matrix representation:

In order to avoid this, we use homogenous co-ordinate system.

Rotation about the Origin:


In this, the object is rotated θ° about the origin. Direction of rotation is
clockwise if θ is a –ve angle and anticlockwise if θ is a +ve angle. Transformation of
rotation is given by:
P’=Rθ(P)
Where x’=xcosθ-ysinθ
y’=xsinθ+ycosθ
x’=rcos(θ+Ø), also x=rcosØ
y’=rsin(θ+Ø), y=rsinØ
rcos(θ+Ø) = r(cosθcosØ – sinθsinØ)
=xcosθ-ysinθ
rsin(θ+Ø) = r(sinθcosØ + cosθsinØ)
= xsinθ+ycosθ

Scaling with respect to origin:


It is the process of expanding or compressing the dimensions of an object.
SxScaling constant
Sy=Scaling constant
A scaling constant >1 indicates an expansion of length.
A scaling constant <1 indicates compression of length.
Scaling transformation is given by :
P’=Ssx,sy(P) where
X’=Sx.x
Y’=Sy.y
Sx=2, Sy=1/2
Scaling transformation is said to be homogeneous or uniform
S>1, magnification.
S<1, reduction.

Mirror reflection about an Axis:


Mirror transformation is given by(about X axis)

P’=Mx(P)
Where x’=x, y’=-y

Mirror transformation about y axis:


P’=My(P)
Where x’=-x and y’=y

Inverse Geometric Transformation:

Translation:Tv-1 = T-v or translation in the opposite direction


Rotation:Rө-1 = R-ө or rotation in the opposite direction.
Scaling:Ssx,sy-1 = S1/sx. 1/sy
Mirror Reflection: Mx-1 = Mx
My-1=My

Co-ordinate Transformation:

Suppose that we have two co-ordinate systems in the plane. The first system is
located at origin O and has co-ordinate axis XY. The second co-ordinate system is
located at origin O’ and has co-ordinate axis X’Y’.

Translation:

x’=x-tx
y’=y-ty
(x’,y’)=Tv’(x,y)
Rotation about the origin:

x’=rcos(Ø-θ)
y’=rsin(Ø-θ)
x=rcosθ
y=rsinθ
x’=xcosθ+ysinθ
y’=-sinθ+ycosθ
(x’,y’)=Rө’(x,y)
Scaling with respect to origin:

(x’,y’) =S’sx,sy(x,y)
Where x’=(1/sx)x and y’=(1/sy)y

Sx=2
Sy=1/2

Inverse coordinate Transformation:

Translation:- Tv-1’ =T-v


Rotation:-Rө-1’ = R-ө’
Scaling:-Ssx,sy-1’ = S1/sx,1/sy’
Mirror Reflection:-Mx-1’ = Mx’ and My-1 = My’

Composite transformation:
More complex and geometric and co-ordinate transformation can be built
from the basic transformations by using the process of composite of functions.
Example:- Magnification of an object by keeping its center fixed. Let the
geometric center be located at C(h,k). S>1.
We construct the transformation by performing the following steps:
1. Translate the object so that its center coincides with origin.
2. Scale the object with respect to origin.
3. Translate the scaled object back to the original position.

The required transformation can be formed by composition.

Ss,c =Tv.Ss,s.Tv-1
Where v=hI+kJ

Notations:
1. Ssx,sy,p  scaling with respect to a fixed point P.
2. Rө,p  rotation with respect to a fixed point P.
3. Ml  reflection about a line l
This is also known as concatenation of matrix.
We must be able to represent the basic transformations as 3*3 homogeneous co-ordinate
matrices so as to be compatible with the matrix of translation. For this we add third

column and a third row [0 0 1] ie.

General pivot point Rotation:


1. Translate the object so that the pivot point (rotation point) is moved to the co-
ordinate origin.
2. Rotate the object about the co-ordinate origin.
3. Translate the object so that the pivot point is returned to its original position.
Composite transformation matrix looks like this:--

T(Xr,Yr).R(θ).T(-Xr,-Yr) = R(Xr,Yr,θ)
Composite matrix resulting from the product of these 3 transformations:-

You might also like