Question: Scaling Transformations: A 2D point can be scaled by multiplication of the coordinate values (x,y) by scaling factors Sx and Sy to produce the transformed
Scaling Transformations:
A 2D point can be scaled by multiplication of the coordinate values (x,y) by scaling factors Sx and Sy to produce the transformed
coordinates (x',y').
Translation Transformations:
A 2D point can be translated by adding the coordinate values (x,y) by Translation distances Tx and Ty to produce the
transformed coordinates (x',y').
Rotation Transformations:
A 2D point can be rotated by repositioning it along a circular path in the xy plane. We specify the rotation angle and the
position of the rotation point about which the object is to be rotated. Multiplication of the coordinate values (x,y) by rotation
matrix produce the transformed coordinates (x',y').
Now you have to design a program which will provide you with the option that which type of transformation you want to do.
Like the following,
Enter your choice:
1. Translation
2. Scaling
3. Rotation
4. Exit
After providing the choice you have to enter the number of edges of a polygon and then you have to input the coordinates of
each vertex. Like the following,
Enter your choice: 3
Enter the no. of edges:-4
Enter the co-ordinates of vertex 1:- 30 30
Enter the co-ordinates of vertex 2:- 30 90
Enter the co-ordinates of vertex 3:- 90 90
Enter the co-ordinates of vertex 4:- 90 30
Enter the degree: 90
Enter the Mood: 1 for clockwise, 2 for anticlockwise
After that you have to draw two polygons, one is the original polygon with supplied vertices and another is the transformed one.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
