06-07-2012, 03:50 PM
2 -DIMENSIONAL TRANFORMATIONS
To perform the various 2-dimensional transformations such as scaling, reflection and shearing.
Algorithm
Step 1: Input the figure.
Step 2: Display the menu as 1.Scaling 2.Reflection 3.Shearing 4.Exit
Step 3: Get the choice from the user.
Step 4: If the choice is 1 get the scaling factor. Multiply the coordinate values of each vertex by scaling factors to produce the transformed coordinates.
Step 5: If the choice is 2 get the axis of reflection. Mirror image is generated relative to an axis of reflection by rotating the object 180◦ about the reflection axis.
Step 6: If the choice is 3 shearing is done which causes the transformation that distorts the shape of an object.
Step 7: If choice is 4 exit the program.