19-12-2012, 06:26 PM
3D-TRANSFORMATION
3D-TRANSFORMATION.docx (Size: 13.66 KB / Downloads: 22)
Algorithm:
1. Start the program.
2. Read the variables x1, y1, x2, y2, d, a, op.
3. Get the choice of an action to be performed, whether translation, scaling, rotation using switch case structure.
4. Read the translation factor &scaling, factor for t&s.
5. Read the x, ycordinates
5.1. Read the angle value.
5.2. To calculate x1, y1, x2, y2 values using the formula
x1=x+(x1-x)*cos(a)-(y1-y)*sin(a);
y1=y+(x1-x)*sin (a) + (y1-y)*cos (a);
X2=x+(x2-x)*cos (a)-(y2-y)*sin (a);
y2=y+(x2-x)*sin (a) + (y2-y) +cos (a);
6. Stop the program.