Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
73 views3 pages

CG Assignment 2 Sayan Maiti CSE/17/18

The document describes using a homogeneous coordinate system to solve two problems: 1) Magnifying a rectangle twice in width and thrice in height while keeping one point fixed, obtaining new points A'B'C'D' 2) Rotating the magnified rectangle A'B'C'D' 90 degrees counter-clockwise around point D', giving final points A''B''C''D'' The transformations and calculations to obtain the new point coordinates are shown.

Uploaded by

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

CG Assignment 2 Sayan Maiti CSE/17/18

The document describes using a homogeneous coordinate system to solve two problems: 1) Magnifying a rectangle twice in width and thrice in height while keeping one point fixed, obtaining new points A'B'C'D' 2) Rotating the magnified rectangle A'B'C'D' 90 degrees counter-clockwise around point D', giving final points A''B''C''D'' The transformations and calculations to obtain the new point coordinates are shown.

Uploaded by

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

CG Assignment 2

Sayan Maiti

CSE/17/18

Use homogeneous co-ordinate system to solve the following problems:

1. Magnify a rectangle A (3,3), B (7,3), C (7,8), D (3,8) twice of its width and thrice of its height while keeping
A (3,3) fixed to obtain a new rectangle A'B'C'D'.
2. Now rotate the magnified rectangle A'B'C'D' by 90-degree CCW w.r.t point D'. Show the final result.

Ans:

Part-1:

Given, A (3,3) B (7,3) C (7,8) D (3,8)

Therefore, the given points in homogenous coordinate will be given by

A (3 3 1) B (7 3 1) C (7 8 1) D (3 8 1)

It is to be scaled keeping A fixed.

Now, the transformation matrix for the fixed-point scaling is given by

1 0 0 2 0 0 1 0 0
Sf = [0 1 0 ] . [0 3 0 ] . [0 1 0]
−3 −3 1 0 0 1 3 3 1
2 0 0 1 0 0
= [0 3 0 ] . [0 1 0]
−6 −9 1 3 3 1
2 0 0
= [0 3 0]
−3 −6 1
Now,

P’ = P. Sf

3 3 1
2 0 0
7 3 1
= [ ].[ 0 3 0]
7 8 1
−3 −6 1
3 8 1
3 3 1
11 3 1
= [ ]
11 18 1
3 18 1
Therefore, the modified coordinates are

A’ (3,3) B’ (11, 3) C’ (11,18) D’ (3,18)


Part-2

The magnified rectangle A’B’C’D’ is to be rotated 90o counter clockwise with respect to vertex D

Then the transformation matrix is given by,

Rm = 𝑇(−3, −18). 𝑇(𝜃). 𝑇(3,18)


1 0 0 cos 90 sin 90 0 1 0 0
= [0 1 0] . [−sin 90 cos 90 0] . [0 1 0]
−3 −18 1 0 0 1 3 18 1
0 1 0 1 0 0
= [−1 0 0] . [0 1 0]
18 −3 1 3 18 1
0 1 0
= [−1 0 0]
21 15 1
Now,

𝑃′ = 𝑃. 𝑅𝑚
3 3 1
0 1 0
11 3 1
=[ ] . [−1 0 0]
11 18 1
21 15 1
3 18 1
18 18 1
18 26 1
=[ ]
3 26 1
3 18 1

Therefore, the coordinates of the rotated rectangle are

A’’ (18,18) B’’ (18,26) C’’ (3,26) D’’ (3,18)

You might also like