less than 1 minute read

``` //5. Write a program to Implement Shearing of Rectangle. //shearing #include #include #include #include #include int x1,y1,x2,y2,x,y; int main(void) { int gdriver = DETECT, gmode, errorcode; clrscr(); initgraph(&gdriver, &gmode, "c:\\tc\\bgi"); cout<<"enter the top left coordinates:"; cin>>x1>>y1; cout<<"enter the bottom right coordinates:"; cin>>x2>>y2; cout<<"enter the values of shearing coordinate for x_shear:\n"; cin>>x; cout<<"enter the values of shearing coordinate for y_shear:\n"; cin>>y; cleardevice(); rectangle(x1,y1,x2,y2); cout<<"now hit a key to see shear in x_axis:"; getch(); rectangle(x1,y1,x2*x,y2); cout<<"\nnow hit a key to see shear in y_axis:"; getch(); rectangle(x1,y1,x2,y2*y); getch(); closegraph(); } ``` </div>

Leave a comment