01/05/2026

The relation between escape time fractals and chaos game fractals

I had the insight that both escape time fractals and "chaos game" fractals involve some kind of iteration. Some fractals can even be visualized by both ways: the escape time algorithm and the chaos game. One example of this is the Sierpinski triangle, which (or its approximation) I've visualized by the chaos game in a previous blog post, as well as by the escape-time fractal algorithm of the fractal zoomer software called XaoS (although the latter actually showed the areas that are NOT part of the fractal, with different colors depending of the escape time). Yesterday I had the idea what if I tried to visualize the Mandelbrot set by the chaos game, especially the points that are part of that fractal by different colors (so points that are usually black in other fractal generators, as those software visualize those points that are not part of the fractal instead, by different colors).

I had the insight that we could continue the iteration of the escape-time algorithm of the Mandelbrot set in the opposite direction! So, instead of taking:

z=z^2+c

we could take:

z=sqrt(z-c)

Okay, but there are two square roots of a complex number! Well, it is just handy for us, because we can introduce a random element in the iteration that is required by the chaos game anyway. So we take one of the square roots randomly. Thus I tried to implement it by JavaScript yesterday, but always the same picture appeared, no matter what was the initial value of z and what was the constant c:

Soon I realized that I've forgotten to subtract c in the algorithm, so different pictures appeared afterwards, depending on the random c value (but note that they did not much depend on the random initial value of z):


Still, the images did not look nice enough, as you can see, because there were too little amount of points belonging to the resulting fractals. So I had the idea what if I take:

z=cbrt(z-c)

Where cbrt is the cube root of its argument (I just took the complex cube root formula from WikiPedia, just like the complex square root formula). Again, there are three cube roots of a complex number, and it is good for us. This was handy for two reasons: it produced more points, and it made it easier to color the points, as there are 3 main colors: red, green and blue, just like there are 3 possible ways of taking the cube root. Now this method produced nicer pictures than the previous one:






Notice that the second picture of this kind is zoomed. I've implemented basic zooming, but I emphasize that the chaos game is generally poor in zooming, because the random iteration always wanders in the full area of the fractal, so we cannot zoom deep. That's why my method will probably not be a very popular one, and it will not replace the escape time fractal algorithm.

By the way, these pictures look like the Julia sets of the fractal z=z^3+c.

The previous pictures are of 640x480 resolution, but I've made two pictures for those who like changing wallpapers. So:

 

 

That's about the relationship of the escape time fractal iteration and the chaos game fractal iteration.

No comments:

Post a Comment