Posts

Showing posts from April, 2021

Assignment 6 2D Transformation

Image
AIM: Implement following 2D transformations on the object with respect to axis : i) Scaling ii) Rotation about arbitrary point iii) Reflection iv)Translation   Translation: Translation is defined as moving the object from one position to another position along straight line path.     We can move the objects based on translation distances along x and y axis. tx denotes translation distance along x-axis and ty denotes translation distance along y axis. Translation Distance: It is nothing but by how much units we should shift the object from one location   to another along x, y-axis. Consider (x,y) are old coordinates of a point. Then the new coordinates of that same point (x’,y’) can be obtained as follows: X’=x+tx Y’=y+ty     Scaling:   scaling refers to changing the size of the object either by increasing or decreasing. We will increase or decrease the size of the object based on scaling factors along x and y -axis. If (x, y) are old coordinates of object, then new c