c/c++ code
voidCMy1400801119View::OnDraw(CDC* pDC)
{
CMy1400801119Doc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
int R=100;
int x0=0,y0=R;
int x,y,e;
e=1-R;
x=x0;
y=y0;
while(y>=x){
pDC->SetPixel(x+300,y+300,RGB(20,180,29));
pDC->SetPixel(x+300,-y+300,RGB(20,180,29));
pDC->SetPixel(-x+300,y+300,RGB(20,180,29));
pDC->SetPixel(-x+300,-y+300,RGB(20,180,29));
pDC->SetPixel(y+300,x+300,RGB(20,180,29));
pDC->SetPixel(y+300,-x+300,RGB(20,180,29));
pDC->SetPixel(-y+300,x+300,RGB(20,180,29));
pDC->SetPixel(-y+300,-x+300,RGB(20,180,29));
if(e<0){
e=e+2*x+3;
x=x+1;
}
else{
e=e+2*(x-y)+5;
x=x+1;
y=y-1;
}
}
float RR=100;
float xx0=0,yy0=RR;
float xx,yy;
xx=xx0;
yy=yy0;
float a2=150*150,b=100,b2=100*100;floatee1,ee2;
ee1=b2+a2*(-b+0.25);
while(b2*(xx+1)<a2*(yy-0.5)){
pDC->SetPixel(xx+600,yy+300,RGB(20,180,29));
pDC->SetPixel(xx+600,-yy+300,RGB(20,180,29));
pDC->SetPixel(-xx+600,yy+300,RGB(20,180,29));
pDC->SetPixel(-xx+600,-yy+300,RGB(20,180,29));
if(ee1<0){
ee1=ee1+b2*(2*xx+3);
xx=xx+1;
}
else{
ee1=ee1+b2*(2*xx+3)+a2*(-2*yy+2);
xx=xx+1;
yy=yy-1;
}
}
ee2=b2*(xx+0.5)*(xx+0.5)+a2*(yy-1)*(yy-1)-a2*b2;
while(yy>=0){
pDC->SetPixel(xx+600,yy+300,RGB(20,180,29));
pDC->SetPixel(xx+600,-yy+300,RGB(20,180,29));
pDC->SetPixel(-xx+600,yy+300,RGB(20,180,29));
pDC->SetPixel(-xx+600,-yy+300,RGB(20,180,29));
if(ee2<0){
ee2=ee2+b2*(2*xx+2)+a2*(-2*yy+3);
xx=xx+1;
yy=yy-1;
}
else{
ee2=ee2+a2*(-2*yy+3);
yy=yy-1;
}
}
}