English 中文(简体)
理解分形,特别是曼德尔布罗特
原标题:understanding fractals and especially mandelbrot set

为了理解我读到的一段引文 上面写着"我们越是放大分形内部 就越需要做越多的迭代"

so far, i haven t been able to find any mathematical / academical paper that proves that saying. i ve also managed to find a small code that calculates the mandelbrot set, taken from here : http://warp.povusers.org/Mandelbrot/ but yet, wasn t able to understand how zooming affects iterations.

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); }
    }
}

谢谢!

最佳回答

这不是科学的答案,而是一个常识的答案。在理论上,为了决定一个点是否属于曼德尔布罗特设置,你应该反复使用“绝对 < / em ”, 并检查该值是否达到“ime> Infinity < / em ” 。 这实际上毫无用处,所以我们假设:

  1. We iterate only 50 times
  2. We check that iteration value ever gets larger than 2

当放大到 Mandelbrot 设置中时,第二个假设仍然有效。然而,“强度”对齐

Say you start with (0.4,-0.2i). Iterating over and over this value increases the digits used, but won t lose significant digits. Now when your point coordinate looks such: (0.00000000045233452235, -0.00000000000943452634626i) to check if that point is in the set you need much more iteration to see if that iteration would ever reach 2 not to mention that if you use some kind of Float type, you will lose significant digits at some zoom level and you ll have to switch to an arbitrary precision library.

尝试是您最好的朋友 :-) 计算一组低迭代和高迭代,然后从第一个图像中减去第二个图像。 您将总是看到边缘的变化( 黑色像素与彩色像素相交), 但如果您的缩放水平较高( 意思是: 点坐标有很多分数位数), 您将得到不同的图像 。

问题回答

您询问缩放如何影响迭代, 我典型的缩放与迭代比率是, 如果您将缩放放大到大小的九分之一, 我将迭代增加1.7。 课程大小的九分之一意味着宽度和高度除以3。

使这个更通用化 我实际上用在代码中

Complex middle = << calculate from click in image >>
int zoomfactor = 3;
width = width / zoomfactor;
maxiter = (int)(maxiter * Math.Sqrt(zoomfactor));
minimum = new Complex(middle.Real - width, middle.Imaginary - width);
maximum = new Complex(middle.Real + width, middle.Imaginary + width);

我发现放大和迭代之间的关系 效果相当不错 分形中的细节 仍然在深层放大中出现

如果您自己喜欢的话, 您想要缩放的速度有多快, 我喜欢一个3的缩放器, 但什么都行。 重要的是, 您需要保持 缩放器与插座增加之间的关系 。





相关问题
Genetic Programming with the Mandelbrot Set

I m reading a chapter in this fascinating book about using genetic programming to interactively evolve images. Most of the function set is comprised of simple arithmetic and trig functions (which ...

How to render Mandelbulb-style 3D fractals

I m interested in experimenting with equations for 3D fractals (a la Mandelbulb). Does anyone know of a framework that will allow me to supply a 3-coordinate, Mandelbrot-style function, identifying a ...

Fractal terrain generation problem

I m trying to get a simple 1D fractal terrain generator to work for a 2D game. But for some reason it always either makes a hill, a valley, or a flat line, as seen in this output of the segments (x1, ...

improving drawing pythagoras tree

I have written program for drawing pythagoras tree fractal. Can anybody see any way of improving it ? Now it is 89 LOC. import java.awt.*; import java.util.Scanner; import javax.swing.*; public ...

Fractal based Image compression algorithm (and source code)

I am looking for a decent fractal based compression algorithm for images. So far I only find dead links to the FIF image format and dead links pointing to Iterated Systems Inc which then became ...

How to model rules for generating geometric patterns?

For my problem it would be best to find a numeric representation of kazakh national ornaments for generating new ones. But other approaches are also fine. The ornaments essentially consist of ...

Code golf: the Mandelbrot set

Usual rules for the code golf. Here is an implementation in python as an example from PIL import Image im = Image.new("RGB", (300,300)) for i in xrange(300): print "i = ",i for j in xrange(...

热门标签