Title: Newton Fractal Smoothing Post by: fodinabor on April 23, 2015, 03:02:42 PM Hey Guys,
I'm writing myself a Newton Fractal Generator. The images all formerly looked like this: (http://i.stack.imgur.com/ROclJ.png) But I actually would like it to look a bit smoother - so I've done some research and I ran over http://www.hiddendimension.com/FractalMath/Convergent_Fractals_Main.html and some threads here and no it looks nearly fine, except that there are some issues at the edges of the basins.. (http://i.stack.imgur.com/9Wpc8.png) This is my generation loop (it's ran in a OpenCL Kernel): Code: while (i < 6000 && fabs(z.r) < 10000 && !found){The coloration: Code: const int xRes = res[0]; The full source code: http://git.war-of-universe.com/fodinabor/newton-fraktale I appreciate any help to actually smooth this ;-) Thanks, - fodinabor Title: Re: Newton Fractal Smoothing Post by: claude on April 23, 2015, 05:57:45 PM I'd not seen the method you linked before, I'll have to try it sometime. I use the ones described here:
http://www.chiark.greenend.org.uk/~sgtatham/newton/ Quote a good ad-hoc approximation is obtained simply by looking at the last iteration, in which the point first comes within the specified distance of a root. We look at the distance D0 from the previous point to the root and the distance D1 from the new point to the root, and we know that the threshold distance T is somewhere in between the two. I've found that simply looking at (log T-log D0)/(log D1-log D0), in other words whether the log of the threshold radius was near to the start or the end of the inward distance travelled by the point (on a logarithmic scale), produces a perfectly acceptable result You either add or subtract that expression from the integer iteration count, can't remember which.Here's my GLSL implementation: http://code.mathr.co.uk/fractaloids/blob/HEAD:/webgl/fractaloids.html#l39 Some example videos using variations of that code: http://mathr.co.uk/blog/2012-12-24_fractal_juggling.html You might also be interested in distance estimation, here's a post about that too: http://mathr.co.uk/blog/2013-06-22_distance_estimation_for_newton_fractals.html Title: Re: Newton Fractal Smoothing Post by: fodinabor on April 23, 2015, 06:25:22 PM I translated: (log T-log D0)/(log D1-log D0) into (log(RESOLUTION) - log(fabs(subComplex(zo, zeros[j]).r))) / (log(fabs(subComplex(z, zeros[j]).r)) - log(fabs(subComplex(zo, zeros[j]).r)));
zo is the old z, and zeros[j] is the root the Newton Method is converging to, .r is the abs value (sqrt(t.re*t.re + t.im*t.im)) (http://i.imgur.com/NX9mBX6.png) Title: Re: Newton Fractal Smoothing Post by: claude on April 23, 2015, 07:14:48 PM looks good - now you just need to add the iteration count and adjust the colouring range - something like
Code: col.setColorHSV(col.getHue(), col.getSaturation(), 1- (it + conDiv)/maxIters); Title: Re: Newton Fractal Smoothing Post by: fodinabor on April 23, 2015, 09:12:13 PM thanks!
The coloration now looks like this: Code: int maxIters = 0; and the result is: (http://imgur.com/P9VjTdY.png) Title: Re: Newton Fractal Smoothing Post by: fodinabor on April 23, 2015, 10:12:42 PM hmm... I'd still get the exponential smoothing thing get to work.. it looks a little bit nicer and you don't have to say what to use as maxIters (as it does not smooth anything when using the real max val...
Title: Re: Newton Fractal Smoothing Post by: Pauldelbrot on April 24, 2015, 04:38:04 AM Convergent basins are probably best smooth-colored by first finding a point belonging to the attractor and the attractor's period p, then examining every pth step of the orbit of a point that goes to that attractor and:
I use the second method in many of my own images to produce smooth basin coloring for, for instance, Julia set interiors. |