#include #include #include #include void main() { struct point { int x,y; } p1, pbe; int lon,sho,Drive, Mode; float i, tx, ty, x, y; int j; printf("give me the circle point --> "); scanf("%d %d",&p1.x,&p1.y); printf("input the long and shor axis --> "); scanf("%d %d",&lon,&sho); Drive=DETECT; initgraph(&Drive, &Mode, ""); setcolor(14); line(0,p1.y,639,p1.y); line(p1.x,0,p1.x,479); for (j=0,i=0; i<=6.2830; i+=0.05) { tx=lon/cos(i); ty=sho*tan(i); x=p1.x+tx; y=p1.y-ty; if ((x < 0) || (x > 639) || ( y < 0) || (y > 479)) { j=0; continue; } if (j == 0) { moveto(x,y); j=1; } else lineto(x,y); delay(2000); /* putpixel(x,y,6); */ } getche(); closegraph(); }