To rotate a point at a given angle

//To rotate a point at a given angle #include<iostream.h> #include<graphics.h> #include<conio.h> #include<math.h> void main() { int x,y,theta; float n=3.14159/180; cout<<“\n\t\t\t\*Rotation of a point*\n”; cout<<“\nenter the x and y coordinates:-\n”; cin>>x>>y; …

To perform mirroring on a point

//To perform mirroring on a point #include<iostream.h> #include<graphics.h> #include<conio.h> void main() { int x,y,r,y1; char ab; cout<<“\n\t\t\t\*Mirroring of a point*\n”; cout<<“enter the x and y coordinates:-\n”; cin>>x>>y; cout<<“\n*press 1 for …

To implement shearing on rectangle

//To implement shearing on rectangle #include<iostream.h> #include<graphics.h> #include<conio.h> void main() { int x1,y1,x2,y2,s,g,p,q; float sx,sy; cout<<“\n\t\t\t\*To show shearing effect on rectangle*\n”; cout<<“\nenter the x1 and x2 coordinates:-\n”; cin>>x1>>x2; cout<<“\nenter the …

To draw an rectangle

//To draw an rectangle #include<iostream.h> #include<graphics.h> #include<conio.h> void main() { int x1,y1,x2,y2; cout<<“\n\t\t\t\*To draw an rectangle*\n”; cout<<“\nenter the x coordinates(x1 and y2):-\n”; cin>>x1>>x2; cout<<“\nenter the y coordinates(y1 and y2):-\n”; cin>>y1>>y2; …

To draw an ellipse using trignometric method

//To draw an ellipse using trignometric method #include<iostream.h> #include<graphics.h> #include<conio.h> #include<math.h> void put4pixel(int,int,int,int); void main() { int x,y,x1,y1,a,b,h,k,theta; float p=3.14159/180; cout<<“\n\t\t\t\*Trignometric method to draw an ellippse*\n”; cout<<“\nenter the x and …

To draw an ellipse using polynomial method

//To draw an ellipse using polynomial method #include<iostream.h> #include<graphics.h> #include<conio.h> #include<math.h> void plot4pixels(int,int,int,int); void main() { int x,y,r,i,h,k,a,b; cout<<“\n\t\t\t\*Polynomial method to draw an ellipse*\n”; cout<<“\nenter the x and y coordinates:-\n”; …

To draw an ellipse using mid point method

//To draw an ellipse using mid point method #include<iostream.h> #include<graphics.h> #include<conio.h> #include<math.h> void main() { int x,y,r,i,h,k,a,b,fx=0,fy,p; cout<<“\n\t\t\t\*Mid point method to draw an ellipse*\n”; cout<<“\nenter the x and y coordinates:-\n”; …

To draw a sector

//To draw a sector #include<iostream.h> #include<graphics.h> #include<conio.h> #include<math.h> void main() { int x,y,r,i,h,k,s,g; cout<<“\n\t\t\t\*To draw a sector*\n”; cout<<“\nenter the x and y coordinates:-\n”; cin>>h>>k; cout<<“\nenter the radius:-\n”; cin>>r; x=s=0; y=g=r; …

To draw a circle using trignometric method

//To draw a circle using trignometric method #include<iostream.h> #include<graphics.h> #include<conio.h> #include<math.h> void put8pixel(int,int,int,int); void main() { int x,y,x1,y1,r,h,k,theta; float n=3.14159/180; cout<<“\n\t\t\t\*Trignometric Method to draw a circle*\n”; cout<<“\nenter the x and …

To draw a circle using polynomial method

//To draw a circle using polynomial method #include<iostream.h> #include<graphics.h> #include<conio.h> #include<math.h> void plot8pixel(int,int,int,int); void main() { int x,y,r,h,k; cout<<“\n\t\t\t\*Polynomial method to draw a circle*\n”; cout<<“\nenter the x and y coordinates:-\n”; …