Thursday, August 16, 2012
Midpoint Circle Algorithm Using C Programming
#include<stdio.h>#include<conio.h>
#include<graphics.h>
void main()
{
#include<graphics.h>
void main()
{
int gd=DETECT,gm;}
int x,y,r;
void Drawcircle(int,int,int);
printf("Enter the Mid points and Radious:");
scanf("%d%d%d",&x,&y,&r);
initgraph(&gd,&gm,"");
Drawcircle(x,y,r);
getch();
closegraph();
void Drawcircle(int x1,int y1,int r)
{
int x=0,y=r,p=1-r;
void cliplot(int,int,int,int);
cliplot(x1,y1,x,y);
while(x<y)
{
x++;
if(p<0)
p+=2*x+1;
else
{
y--;
p+=2*(x-y)+1;
}
cliplot(x1,y1,x,y);
}
}
void cliplot(int xctr,int yctr,int x,int y)
{
{
putpixel(xctr +x,yctr +y,1);
putpixel(xctr -x,yctr +y,1);
putpixel(xctr +x,yctr -y,1);
putpixel(xctr -x,yctr -y,1);
putpixel(xctr +y,yctr +x,1);
putpixel(xctr -y,yctr +x,1);
putpixel(xctr +y,yctr -x,1);
putpixel(xctr -y,yctr -x,1);
getch();
}
Related Posts : C,
cg lab,
Computer Graphics programs,
programming
Subscribe to:
Post Comments (Atom)
Iron Plated Chrome - titanium oxide - TITIAN ONLINE
ReplyDeleteIron Plated Chrome - titanium oxide. The titanium solvent trap tic-tac-toe-gold-plate titanium sponge has titanium flashlight an titanium ore terraria aluminium oxide base and titanium quartz an aluminum oxide base. The copper oxide base offers a
mc209 goodr sunglasses,reef oasis slides,mou moccasins,armani perfume,fabletics joggers,schutz españa,quiksilver lentes,harry's shower gel set,jw pei netherlands ro739
ReplyDelete