为了理解我在某处读到的一句话,“我们放大分形越多,我们最可能需要执行的迭代越多”,我真的在挠挠头。了解分形特别是mandelbrot集
到目前为止,我还没有找到任何证明这种说法的数学/学术论文。 我还设法找到了一个小码计算Mandelbrot集,从这里取: http://warp.povusers.org/Mandelbrot/ 不过不失,是无法理解缩放如何影响迭代。
double MinRe = -2.0;
double MaxRe = 1.0;
double MinIm = -1.2;
double MaxIm = MinIm+(MaxRe-MinRe)*ImageHeight/ImageWidth;
double Re_factor = (MaxRe-MinRe)/(ImageWidth-1);
double Im_factor = (MaxIm-MinIm)/(ImageHeight-1);
unsigned MaxIterations = 30;
for(unsigned y=0; y<ImageHeight; ++y)
{
double c_im = MaxIm - y*Im_factor;
for(unsigned x=0; x<ImageWidth; ++x)
{
double c_re = MinRe + x*Re_factor;
double Z_re = c_re, Z_im = c_im;
bool isInside = true;
for(unsigned n=0; n<MaxIterations; ++n)
{
double Z_re2 = Z_re*Z_re, Z_im2 = Z_im*Z_im;
if(Z_re2 + Z_im2 > 4)
{
isInside = false;
break;
}
Z_im = 2*Z_re*Z_im + c_im;
Z_re = Z_re2 - Z_im2 + c_re;
}
if(isInside) { putpixel(x, y); }
}
}
谢谢!
我有一个用Postscript [here](http://code.google.com/p/xpost/downloads/detail?name=mandel2.ps)编写的交互式Mandelbrot生成器。它可以通过交互提示直接控制迭代(值'/ maxit'),但也可以将迭代缩放为缩放的副作用。 –