int PixelIteration(float x, float y,CComplex& Zn, int depth)
{
if (depth>50)
{
if (Zn.Magnitude()>=2)
return depth;
else
return 0;
}
CComplex Zn1(x,y);
Zn.Sqr();
Zn1=Zn1-Zn;
if (Zn1.Magnitude()>=2)
return depth;
else
return PixelIteration(x,y,Zn1,depth+1);
} |