Exponential smoothing of Newton's fractal

I write myself with Newton's Fractal Generator. All the images looked like this: FractalUnsmoothed But I really would like it to look a little sleek - of course I did some research and I ran http://www.hiddendimension.com/FractalMath/Convergent_Fractals_Main.html and it looks rather correct for except that there are some problems at the edges of the pools .. Exponential Smoothed

This is my generation cycle:

while (i < 6000 && fabs(z.r) < 10000 && !found){
    f = computeFunction(z, params, paramc[0]);
    d = computeFunction(z, paramsD, paramc[1]);

    iterexp = iterexp + exp(-fabs(z.r) - 0.5 / (fabs(subComplex(zo, z).r)));

    zo = z;

    z = subComplex(z, divComplex(f, d));

    i++;

    for (int j = 0; j < paramc[0] - 1; j++){
        if (compComplex(z, zeros[j], RESOLUTION)){
            resType[x + xRes * y] = j;
            result[x + xRes * y] = iterexp;
            found = true;
            break;
        }
    }

    if (compComplex(z, zo, RESOLUTION/100)){
        resType[x + xRes * y] = 12;
        break;
    }
}

      

Colour:

const int xRes = res[0];
const int yRes = res[1];

for (int y = 0; y < fraktal->getHeight(); y++){
    for (int x = 0; x < fraktal->getWidth(); x++){
        int type, it;
        double conDiv;
        if (genCL && genCL->err == CL_SUCCESS){
            conDiv = genCL->result[x + y * xRes];
            type = genCL->typeRes[x + y * xRes];
            it = genCL->iterations[x + y * xRes];
        } else {
            type = 3;
            conDiv = runNewton(std::complex<double>((double)((x - (double)(xRes / 2)) / zoom[0]), (double)((y - (double)(yRes / 2)) / zoom[1])), type);
        }

        if (type < 15){
            Color col;
            col.setColorHexRGB(colors[type]);
            col.setColorHSV(col.getHue(), col.getSaturation(), 1-conDiv);
            fraktal->setPixel(x, y, col);
        } else {
            fraktal->setPixel(x, y, conDiv, conDiv, conDiv, 1);
        }
    }
}

      

I appreciate any help to actually iron it out ;-)
Thanks, - fodinabor

+3


source to share





All Articles