To draw a circle using Mid-point method

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

To apply scaling on a rectangle

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

Program to perform transformation of a circle

/* Program to perform transformation of a circle */ #include<iostream.h> #include<graphics.h> #include<conio.h> void main() { int x1,x2,y1,y2,r; cout<<“\n\t\t\t\*To transform a circle*\n”; cout<<“\nenter the x and y coordinates:-\n”; cin>>x1>>y1; cout<<“\nenter the …

Program to perform mirror reflection on a circle

/* Program to perform mirror reflection on a circle */ #include<iostream.h> #include<graphics.h> #include<conio.h> void main() { int x,y,r,y1; char c; cout<<“\n\t\t\t\*Mirroring of a Circle*\n”; cout<<“enter the x and y coordinates:-\n”; …

PROGRAM TO DRAW HUT ON SCREEN

//PROGRAM TO DRAW HUT ON SCREEN #include<iostream.h> #include<conio.h> #include<graphics.h>   void main() { intgd=DETECT,gm; initgraph(&gd,&gm,””); setfillstyle(1,WHITE); floodfill(1,1,GREEN); setcolor(BLACK); line(200,150,170,200); line(200,150,230,200); rectangle(170,200,400,270); line(200,150,400,150); line(400,150,400,200); line(230,200,230,270); circle(200,180,5); rectangle(290,220,340,250); rectangle(190,220,210,270); getch(); }

Program to draw a line using Integer DDA method

/* Program to draw a line using Integer DDA method */ #include<iostream.h> #include<graphics.h> #include<conio.h> #include<math.h> void main() { clrscr(); int x1,y1,x2,y2,x,y,dy,dx,c=0; cout<<“\n\t\t\t\*Integer DDA method to draw a line*\n”; cout<<“\nenter the …

program To draw a line using Direct method

/* program To draw a line using Direct method. #include<iostream.h> #include<graphics.h> #include<conio.h> #include<math.h> void main() { clrscr(); int x1,y1,x2,y2,x,y,dy,dx,b; float m; cout<<“\n\t\t**Line drawing using Direct OR Polynomial method**\n”; cout<<“\nenter the …

Program to draw a line using bresenham’s method

/* Program to draw a line using bresenham’s method */ #include<iostream.h> #include<graphics.h> #include<conio.h> #include<math.h> void main() { clrscr(); int x1,y1,x2,y2,x,y,xend,yend,dy,dx,d; cout<<“\n\t\t\t\**Bresenham’s method to draw a line**\n”; cout<<“\nEnter the x coordinates(x1,x2)\n”; …

Program to draw a compact disc

/* Program to draw a compact disc */ #include<iostream.h> #include<graphics.h> #include<conio.h> void main() { int x,y,r,i; cout<<“\n\t\t\t\t**To draw a compact disc**\n”; cout<<“\nenter the x and y coordinates:-\n”; cin>>x>>y; cout<<“\nenter the …