c语言画的八卦图

 

#include<stdio.h>
#include<graphics.h>
#define S(x) (x/180.0*3.141592653)
#include<conio.h>
void main()
{
initgraph(640,480);//line(320,0,320,480);
//circle(320,240,240);
arc(80,0,560,480,S(-90), S(90));
setcolor(RED);arc(80,0,560,480,S(90), S(-90));
arc(200,240,440,0,S(90), S(-90));
arc(200,240,440,480,S(-90), S(90));
circle(320,120,40);circle(320,360,40);
floodfill(81,240,RED);floodfill(320,120,RED);
setfillstyle(SOLID_FILL,RED);
setcolor(WHITE);circle(320,120,40);
circle(320,360,40);
arc(200,240,440,0,S(90), S(-90));
arc(200,240,440,480,S(-90), S(90));
arc(80,0,560,480,S(90), S(-90));
//rectangle(1,1,640,480);
getch();
closegraph();

}

(本人新手,多谢指教)微笑

 

 

 

   


 

阅读更多

没有更多推荐了,返回首页