#include #include #include #include void main() { int GraphDriver; /* The Graphics device driver */ int GraphMode; /* The Graphics mode value */ struct point { int x,y; } p1,p2; int a,b; float x,y,rad=3.14159/180,i,t,t1,t2; printf("give me the circle point--->"); scanf("%d %d",&p1.x,&p1.y); printf("give me the radius --->"); scanf("%d %d",&a,&b); getche(); GraphDriver = DETECT; /* Request auto-detection */ initgraph( &GraphDriver, &GraphMode, "" ); /* just increasing p1 - p2 */ setcolor(4); ellipse(p1.x,p1.y,0,360,a,b); getche(); clearviewport(); for (i=0; i<=90; i+=0.5) { t=i*rad; t1=a*cos(t); t2=b*sin(t); x=p1.x+t1; y=p1.y+t2; putpixel((int)x,(int)y,2); x=p1.x-t1; y=p1.y+t2; putpixel((int)x,(int)y,3); x=p1.x-t1; y=p1.y-t2; putpixel((int)x,(int)y,5); x=p1.x+t1; y=p1.y-t2; putpixel((int)x,(int)y,6); } getche(); closegraph(); /* Return the system to text mode */ }