Page 137 - DCAP313_LAB_ON_COMPUTER_GRAPHICS
P. 137
Unit 8: Implementing of Scaling in 2D Transformation
switch(ch2) Notes
{
case 1:
printf("Enter the value of shear:n");
scanf("%f",&x1s);
x1=x+(y*x1s);
y1=y;
az1=az+(w*x1s);
w1=w;
rectangle(x1,y1,az1,w1);
break;
case 2:
printf("Enter the value of shear:n");
scanf("%f",&y1s);
x1=x;
y1=y+(x*y1s);
az1=az;
w1=w+(az*y1s);
rectangle(x1,y1,az1,w1);
break;
}
break;
case 6:
exit(0);
}
}
getch();
}
Example OUTPUT Result computer Graphics
Enter the upper left corner of the rectangle:
100
100
Enter the lower right corner of the rectangle:
200
200
******2DTransformations*******
1. Translation
2. Rotation
3. Scaling
4. Reflection
5. Shearing
6. Exit
LOVELY PROFESSIONAL UNIVERSITY 131