小编Gab*_*iel的帖子

我的曼德尔布罗特集在进行少量迭代绘图时显示错误的轮廓

我正在编写一个用 C 语言绘制 Mandelbrot 集的程序。我已经能够显示它并且看起来不错,但是当我减少迭代次数时,我得到了这种效果,生成了我只能描述为“云”的效果: 曼德尔布罗特集

它应该是这样的(我从网站上得到的):

右曼德尔布罗集

我怎样才能让我的看起来像上面的那样?这是绘制单个点的代码:

double getFracPoint(double x,double y){

    //scale x and y
    x = x * ((plotEnd.x-plotStart.x) / SCREENWIDTH) + plotStart.x;
    y = y * ((plotEnd.y-plotStart.y) / SCREENHEIGHT) + plotStart.y;

    x/=zoom;
    y/=zoom;

    //instead of using the complex number library of the C standard
    //I decided to use regular numbers as it turns out to be faster.

    //The first number is the real part the second number is the imaginary
    //part.
    double z[2];
    z[0] = z[1] = …
Run Code Online (Sandbox Code Playgroud)

c math fractals mandelbrot

4
推荐指数
1
解决办法
151
查看次数

标签 统计

c ×1

fractals ×1

mandelbrot ×1

math ×1