Wednesday, 5 December 2012

Esay

1. Draw a figure using different vivid primitives(line, triangle and sphere) and use floodfill. #include #include #include #include union REGS i,o; void main(void) { int gdriver=DETECT, gmode; int xmax, ymax; initgraph(&gdriver, &gmode, \); line(200,100,300,200); line(100,200,200,100); line(100,200,300,200); setfillstyle(1,6); floodfill(200,120,15); rectangle(150,200,250,300); setfillstyle(1,7); floodfill(170,210,15); rectangle(160,260,180,300); putpixel(170,270,4); setfillstyle(1,8); floodfill(170,270,15); line(175,270,175,300); rectangle(200,230,240,270); line(200,240,240,240); line(200,260,240,260); line(230,240,230,260); line(210,240,210,260); line(120,200,120,220); circle(120,230,8); setfillstyle(1,15); floodfill(120,230,15); getch(); closegraph(); }//main() closed 2.
Ordercustompaper.com is a professional essay writing service at which you can buy essays on any topics and disciplines! All custom essays are written by professional writers!
Digital derivative instrument Algorithem (DDA) #include #include #include #include void main() { int gd=DETECT,gm; float xa,ya,xb,yb,xinc,yinc, temporary worker,dx,dy,x,y; printf(\n\n infix the four points :: \n\n ); cin>>xa>>ya; cin>>xb>>yb; initgraph(&gd,&gm,\); dx=abs(xb-xa); dy=abs(yb-ya); if(dx>dy) temp=dx; else temp=dy; xinc=dx/temp; yinc=dy/temp; x=xa,y=ya; putpixel(x,y,col); for(int i=1;ixb) x-=xinc; else x+=xinc; if(ya>yb) y-=yinc; else y+=yinc; putpixel(x,y,col); if(kbhit()) croak; }//for loop closed x=xb,y=yb; putpixel(x,y,15); getch(); closegraph(); } 3. Header file of DDA #include #include void dda_line(float xa,float ya,float xb,float yb) { float xinc,yinc,temp,dx,dy,x,y; dx=abs(xb-xa); dy=abs(yb-ya); if(dx>dy) temp=dx; else temp=dy; xinc=dx/temp; yinc=dy/temp; x=xa,y=ya; putpixel(x,y,15); for(int i=1;ixb) x-=xinc; else x+=xinc; if(ya>yb) y-=yinc; else y+=yinc; putpixel(x,y,3); if(kbhit()) break; }//for loop closed x=xb,y=yb; putpixel(x,y,15); }//main() closed... If you want to get a full essay, order it on our website: Ordercustompaper.com

Ordercustompaper.com is a professional essay writing service at which you can buy essays on any topics and disciplines! All custom essays are written by professional writers!

No comments:

Post a Comment