搞了大半天终于转了
#include<stdio.h>#include<graphics.h>
#include<math.h>
#include<dos.h>
#include<conio.h>
#define pi 3.1415926
#define angle 2*pi/360
void draw_outline(void){
int x[360];
int y[360];
int i=0;
int j=0;
for(i=0;i<360;i++){
x[i]=320+50*cos(i*angle);
y[i]=230+50*sin(i*angle);
}
setcolor(YELLOW);
circle(320,230,100);
ellipse(x[359],y[359],0,180,50,50);
ellipse(x[359-180],y[359-180],180,360,50,50);
for(i=358;i>=0;i--){
j=i-180;
setcolor(YELLOW);
circle(320,230,100);
ellipse(x[i],y[i],0-i,180-i,50,50);
ellipse(x[j],y[j],180-i,360-i,50,50);
setcolor(WHITE);
circle(x[i],y[i],10);
setcolor(YELLOW);
circle(x[j],y[j],10);
setcolor(BLACK);
ellipse(x[i+1],y[i+1],0-i-1,180-i-1,50,50);
ellipse(x[j+1],y[j+1],180-i-1,360-i-1,50,50);
circle(x[i+1],y[i+1],10);
circle(x[j+1],y[j+1],10);
delay(3000);
if(j==0){
setcolor(BLACK);
ellipse(x[i],y[i],0-i,180-i,50,50);
ellipse(x[j],y[j],180-i,360-i,50,50);
circle(x[j],y[j],10);
circle(x[i],y[i],10);
i=358;
}
}
}
int main(void){
int gmode=VGA;
int gdriver=VGAHI;
initgraph(&gmode,&gdriver,"");
draw_outline();
getch();
closegraph();
return 0;
}