发表于:2008-08-31 15:14:15
1楼
/************************************************/
void hua_yuan(uchar Ox,uchar Oy,uchar Rx)
{
unsigned int xx,rr,xt,yt,rs;
yt = Rx;
rr = Rx * Rx + 1; //补偿 1 修正方形
rs =(yt + (yt >> 1)) >>1; //0.75)分开1/8圆弧来画
for(xt = 0; xt <= rs; xt++)
{
xx = xt * xt;
while((yt*yt) > (rr-xx))
{
yt--;
}
col = Ox + xt; //第一象限
row = Oy - yt;
dian(row,col);
col = Ox - xt; //第二象限
dian(row,col);
row = Oy + yt; //第三象限
dian(row,col);
col = Ox + xt; //第四象限
dian(row,col);
//***************45度镜象画另一半***************
col = Ox + yt; //第/一象限
row = Oy - xt;
dian(row,col);
col = Ox - yt; //第/二象限
dian(row,col);
row = Oy + xt; //第/三象限
dian(row,col);
col = Ox + yt; //第/四象限
dian(row,col);
}
}