/*
* Copyleft,PenFe Inc.
* All rights unreserved.
*
* 文件名称:8secplanet.c
* 摘 要:递归方法实现4层8卫星圆图
* 当前版本:0.5
* 作 者:PerFect
* 完成日期:2004-9-18 20:31
*
*替换版本:Beta
*作者:PerFect
*完成日期:2004-9-18 9:06
*/
#include
#include
#include
#include
#define distance 7.0
#define zoom 0.5
#define level 4
int levels;
void secplanet(int x,int y,int r);
main()
{
/*data segment*/
int gdriver=DETECT;
int gmode;
int mx;
int my;
int mr;
/*data initialization*/
initgraph( &gdriver,&gmode,"");
setbkcolor(0);
setcolor(4);
levels=0;
mx=getmaxx()/2;
my=getmaxy()/2;
mr=getmaxy()/25;
/*code segment*/
circle(mx,my,mr);
secplanet(mx,my,mr);
getch();
closegraph();
}
void secplanet(int x,int y,int r)
{
int i;
int tempx;
int tempy;
int tempr;
double angle;
angle=3.1415/8;
levels=levels+1;
if(levels < level-1)
{
while(angle
本文地址:http://com.8s8s.com/it/it22398.htm