0% found this document useful (0 votes)
26 views7 pages

Lecture#5 Basics of 2D Transformations (Autosaved)

The document discusses three basic 2D transformations: translation, scaling, and rotation. Translation moves an object by adding offsets to x and y coordinates. Scaling resizes an object by multiplying x and y values. Rotation uses trigonometric functions to calculate new x' and y' coordinates after rotating around an angle.

Uploaded by

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

Lecture#5 Basics of 2D Transformations (Autosaved)

The document discusses three basic 2D transformations: translation, scaling, and rotation. Translation moves an object by adding offsets to x and y coordinates. Scaling resizes an object by multiplying x and y values. Rotation uses trigonometric functions to calculate new x' and y' coordinates after rotating around an angle.

Uploaded by

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

Computer Graphics 2k17BSCS CE-311

Lecture 5
Basics of 2D transformations
• Three basic transformations
i. Translation
ii. Scaling
iii. Rotation
Basics of 2D transformations
i. Translation
i. Moving from one position to other
ii. tx, ty are the translation parameters with respect to x-axis and y-axis
respectively
ii. Scaling
• Resizing the object
 Maximize OR Minimize
• Sx, Sy are the scaling parameters with respect to x-axis and y-axis respectively
iii. Rotation
i. Clock-wise
ii. Anti-clock-wise
Translation
• Changing the position
• P(x,y) – Original point
• P’(x’,y’) – Point after translation
Two parameters tx,ty
• P’ = P + T
• x’ = x + tx
• y’ = y + ty
• [x’ y’] = [x y] + [tx ty]
Scaling
•  Resize the object
• Max OR Min if Sx&Sy are in if p1k<0 then
between (0,1)
• Sx, Sy are the resizing parameters then yk+1 = yk
• P(x,y) – Original point before scaling • Point is closer so next point
to origin
• P’(x’,y’) – Point after scaling will be
• Size
• x’ = x . Sx decreases (xk+1, yk)
• y’ = y . Sy
• [x’ y’] = [x y]
Basic Trigonometric Equations
• Sin(A+B) = SinA.CosB + CosA.SinB
• Sina(A-B) = SinA.CosB - CosA.SinB
• Cos(A+B) = CosA.CosB – SinA.SinB
• Cos(A-B) = CosA.CosB + SinA.SinB
Rotation
Y
x P(x,y)
New Angle after rotating P to P’ = φ- θ y
r
x’ P’(x’,y’)
Cosφ = x / r
r
x = r Cosφ
φ y’
θ
Sinφ = y / r φ- θ
y = r Sinφ X

Similarly
Cos(φ – θ) = x’ / r
x’ = r Cos(φ – θ) =

Sin(φ – θ) = y’ / r
y’ = r Sin(φ – θ) =

You might also like