Professional Documents
Culture Documents
2D - Transformation
2D - Transformation
• P’ = P *M
shear
• This transformation causes the image to slant.
• The y shear preserves all the x coordinate values but shifts the y values.
• The amount of change in the y value depends upon the x position. This
causes horizontal lines to slope up or down.
P’ = P * SH
SH = [ 1 a ; 0 1] about Y axis shear
•
Homogeneous coordinates
• In the different types of transformations matrix e.g. rotation,
reflection, scaling, shearing etc. the reference point has always been
the origin.
• In some cases it is necessary to modify the position of the origin e.g.
transform every point in the two dimensional plane.
• This can effectively achieved by representing the points by their
homogeneous coordinates.
• Only translation is in the form of vector addition where as others are
in the form of multiplications
• The use of homogeneous coordinate system is vital when there are
multiple operations which include translation, which can also be
represented as a multiplication.
• X=x’ /h
• Y = y’/h
• And h is any non zero number.
• A convenient value for h is 1.
• Any point P expressed as P(x,y,1) in homogeneous coordinate system.
• The general transformation matrix is also modified to a 3X3 matrix
= [a d 0 ; b e 0 ; c f 1]
The important matrix transformation in the
homogeneous coordinate system will now be
modified as under:
• 1. translation
• 2. rotation
• 3. scaling
• 4. reflection
• 5. shear
Concatenation or composite transformation
• A) rotation about any point
• (a) original shape
• (b) translation to origin
• © rotation about origin
• Translation back to original point
• P’ = P T R T¯¹
(B) Scaling about any point :
•ᶿ = 26.565
• As rotation is clockwise, to make it aligned with X axis, we take as
• ᶿ = -26.565
• Concatenated matrix would be:
• G= T*R*M*INV(R)*INV(T)
Problem
• A triangle PRQ has its vertices at P(0,0), Q(4,0) and R(2,3). It is to be
translated by 4 units in X direction, and 2 units in Y direction, then it is
to be rotated in anticlockwise direction about the new position of
point R through 90 degree. Find the new position of the triangle.
Problem
• Calculate the concatenated transformation matrix for the following
operations performed in the sequence as below:
• Translation by 4 and 5 units along X and Y axis.
• Change of scale by 2 units in X direction and 4 units in Y direction.
• Rotation by 60 degree in CCW direction about Z axis passing through the point
(4,4)
What is the effect of the transformation on a triangle ABC with A(4,4), B(8,4)
and C(6,8)
Problem
• A rectangle ABCD is represented by the vertices A(20, 20), B(106.603,
70), C(81.603,113.301), D(-5,63.301). The rectangle is rotated by 30
degree clockwise about the vertex A. determine the new vertex
positions A’,B’,C’ and D’. The transformed rectangle is then to be
moved about a line joining the diagonal vertices A’ and C’. Determine
the new vertices of the rectangle.
• A’(20 20) B’(120 20) C’(120, 70) D’(20,70)