2-D Geometry: Transformations
2-D Geometry: Transformations
TRANSFORMATIONS
1
Some geometrical concepts
Cartesian Coordinates: Characterized by
•An axis of abscissae (x axis)
•An axis of ordinates (y axis)
•An Origin; intersection of x with y
A point on the plane is characterised by a
pair of real numbers P(x,y)
Y
a P (x,y)
x
i
s
X axis 2
Homogeneous Coordinates
The purpose of using homogeneous coordinates is to capture
the concept of infinity as we can’t represent the infinity with the
conventional Cartesian system.
We use two numbers a and w to represent a value v, v=a/w. If
w is not zero, the value is exactly a/w. Otherwise, we identify the
infinite value with (a,0). Therefore, the concept of infinity can be
represented with a number pair like (a, w).
Given a polynomial of degree n, after introducing w, all terms
are of degree n. Consequently, these polynomials are called
homogeneous polynomials and the coordinates (x,y,w) the
homogeneous coordinates.
3
For example
Suppose we have a line
Ax + By + C = 0.
Replacing x and y with x/w and y/w yields
A(x/w) + B(y/w) + C = 0.
Multiplying by w changes it to
Ax + By + Cw = 0.
Similarly, let the given equation be a second degree polynomial
Ax2 + 2Bxy + Cy2 + 2Dx + 2Ey + F = 0.
After replacing x and y with x/w and y/w and multiplying the
result with w2, we have
Ax2 + 2Bxy + Cy2 + 2Dxw + 2Eyw + Fw2 = 0 4
Converting Homogeneous to Cartesian
7
Geometric transformation
The basic geometric transformations are
Translation, Rotation and Scaling
Translation
A translation is applied to an object by
repositioning it along a straight line
path from one coordinate location to
another. We can translate a 2-D point ty
by adding translation distances tx and
ty to the original coordinate position
(x,y) to move the point to new position tx
(x’,y’) i.e.
x’ = x + tx & y’ = y + ty 8
The translation distance pair (tx,ty) is called
translation vector or shift vector
In Matrix form it can be written as follow
P= x P’= x’ T = tx
y y’ ty
P’=P + T
To change the position of a circle or ellipse,
we translate the center coordinates and
redraw the figure at new location
Translation is a rigid body transformation
9
Rotation
Rotation is applied to an object by
repositioning it along a circular path in the xy
plane. We specify a rotation angle and the
position of the rotation point (called pivot
point) about which the object is to be rotated.
+ve values of angle define counterclockwise
rotations
-ve values of angle define clockwise rotation.
10
Using trigonometric identities,
we can represent tranformed
coordinate as follow P’
X’= rcos(Θ+ Φ) (x’,y’)
= r cosΘcos Φ – r sinΘsinΦ
r P
Y’=rsin(Θ+ Φ) r
Θ (x,y)
= r cosΦsinΘ + r cosΘsinΦ Φ
Also
X= rcosΦ and Y=rsinΦ
Therefore
X’ = xcosΘ – ysinΘ
Y’= xsinΘ + ycosΘ 11
In matrix form P’
(x’,y’)
P’=R.P
r P
Where R = cosΘ -sinΘ r
Θ (x,y)
sinΘ cosΘ Φ
(Xr,yr)
14