请教一个WINTC的问题
怎么把这个椭圆变成动态的啊?#include<graphics.h>
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
#include<math.h>
main()
{
float x[361],y[361],s,pi=3.14;
int r,e,h,j,s0,gdriver,gmode,gerror,a;
printf("r=");scanf("%d",&r);
printf("e=");scanf("%d",&e);
printf("h=");scanf("%d",&h);
s0=sqrt(r*r-e*e);
clrscr();
gdriver=VGA; /*设置分辨率为640*480*16色*/
gmode=VGAHI;
initgraph(&gdriver,&gmode,"");
gerror=graphresult();
if(gerror<0)
{
printf("Graphics initialization error!");
printf("%d\n",grapherrormsg(gerror));
exit(1);
}
setbkcolor(BLACK);
line(10,240,630,240);line(320,20,320,450); /*坐标轴,原点为(320,240)*/
circle(320,240,r); /*基圆*/
for(a=0;a<360;a++)
{
for(j=a;j<(360+a);j++)
{
if(j>630 && j<=720)
{
s=0;
}
else if(j>540 && j<=630)
{
s=h-0.5*h*(1-cos(pi*j/90));
}
else if(j>450 && j<=540 )
{
s=h;
}
else if(j>360 && j<=450)
{
s=0.5*h*(1-cos(pi*j/90));
}
else if(j>270 && j<=360)
{
s=0;
}
else if(j>180 && j<=270)
{
s=h-0.5*h*(1-cos(pi*j/90));
}
else if(j>90 && j<=180 )
{
s=h;
}
else
{
s=0.5*h*(1-cos(pi*j/90));
}
x[j]=e*cos(j*pi/180)+(s0+s)*sin(j*pi/180);
y[j]=(s0+s)*cos(j*pi/180)-e*sin(j*pi/180);
x[j]=320+x[j];
y[j]=240-y[j];
setcolor(WHITE);
line(x[j],y[j],x[j],y[j]);
}
for(j=a;j<(360+a);j++)
{
if(j>630 && j<=720)
{
s=0;
}
else if(j>540 && j<=630)
{
s=h-0.5*h*(1-cos(pi*j/90));
}
else if(j>450 && j<=540 )
{
s=h;
}
else if(j>360 && j<=450)
{
s=0.5*h*(1-cos(pi*j/90));
}
else if(j>270 && j<=360)
{
s=0;
}
else if(j>180 && j<=270)
{
s=h-0.5*h*(1-cos(pi*j/90));
}
else if(j>90 && j<=180 )
{
s=h;
}
else
{
s=0.5*h*(1-cos(pi*j/90));
}
x[j]=e*cos(j*pi/180)+(s0+s)*sin(j*pi/180);
y[j]=(s0+s)*cos(j*pi/180)-e*sin(j*pi/180);
x[j]=320+x[j];
y[j]=240-y[j];
setcolor(BLACK);
line(x[j],y[j],x[j],y[j]);
}
}
getch();
closegraph();
}