Buddhabrot Buddhabrot
Render variants

Besides the Buddhabrot technique, there's other render techniques for the Mandelbrot that involve the iterates. Three of them have especially caught my attention:

Buddhagram

Another technique proposed by Melinda Green. It breaks down to merging the Mandelbrot with the Julia and the Buddhabrot, an interesting approach. In the Mandelbrot, Cs on the plane are colored when Z0 is 0, and in the Julia Z0s are colored for a constant C. The idea is to paint Cs' iterates (Buddhabrot) not just when Z0 = 0, but make Z0 a random number; in plain english, that means each painted trajectory belongs to a different Julia.

The name 'Buddhagram' comes from 'Buddhabrot' and 'hologram'; in Green's words, "This extension (of the Buddhabrot technique) is called a 'hologram' because any part of such an image is potentially influenced by all parts of the 4D domain.". Click here to go to the site Green has hung about her Buddhagram; she explains the technique more accurately.

To implement the technique using my schema, you must take into account that the region code optimization is not useful, since now values inside M may tend to infinity (Z0 won't always be 0). I've implemented it this way:

    for (Cr = -2; Cr < 2; Cr += increm) for (Ci = 0; Ci < 2; Ci += increm) {        
      ZrAux = (float)(Math.random() * 4 - 2);
      Zi = (float)(Math.random() * 4 - 2);
      n = 0;
      while (n < maxN) {
        ...
      }  
    }

Logically, this technique can be used on any perspective of the object:

Zr, Zi plane
Zr, Cr plane
Zr, Ci plane
Cr, Ci plane
Cr, Zi plane
Zi, Ci plane
Buddhagram variants

The following images result from painting several Buddhabrots -each one with a distinct and unique Z0- on the same "canvas". To get an idea of what I mean, here's an analogy between this and a scanner: this 4D object has been put through a CAT machine, and a series of evenly spaced slices have come out -each Buddhabrot image has a different Z0, whose module is never grater than 1. To get the final image, all those slices have been printed on the same film. If you look closely at planes (Zr,Cr) and (Zi,Ci), you can see how some of these slices' profiles cut diagonally across the image.

Zr, Zi plane
Zr, Cr plane
Zr, Ci plane
Cr, Ci plane
Cr, Zi plane
Zi, Ci plane

On these drawings, a larger section of the 4D data set is represented than with the Buddhabrot technique, and it's in a more organized manner than the Buddhagram. Despite all that, these drawings are no more spectacular than the good ole Buddhabrot; however, with these Buddhagram variations I've yielded at the very least much pintoresque images.

It occurred to me that if the idea is that "any part of such an image is potentially influenced by all parts of the 4D domain", Z0 doesn't necessarily have to be a random number -it could also be related in some way to C. Trying out stuff, some pretty neat images have popped out. On the Buddhabrot images and animations gallery you can see a few more.

Zr0 = sin Ci, Zi0 = sin Cr
Zr0 = sin Cr, Zi0 = cos Ci
Zr0 = cos Cr, Zi0 = cos Ci
Zr0 = cos Cr, Zi0 = sin Ci
Z0 = sin complex(Ci, Cr i)
Zr0 = sin Cr, Zi0 = sin Ci

I've also rigged up a couple of animations of a plane sweep for each one of Z0's components. They start out at the traditional Buddhabrot (Z0 = 0), but from there onwards, Zr0, Zi0, or both, grow until nothing is visible.

Zr0 = 0
Zi0 = Grows from 0
Zr0 = Grows from 0
Zi0 = 0
Zr0 = Grows from 0
Zi0 = Grows from 0
Negative Buddhabrot

If instead of painting Cs outside M -that is, the Mandelbrot-, we paint those belonging to M, we get what could be understood as its "negative": the Mandelbrot figure appears white, and the exterior area is black.

Now we adapt this approach to the Buddhabrot technique, and the result on the 6 capital planes is this:

Zr, Zi plane
Zr, Cr plane
Zr, Ci plane
Cr, Ci plane
Cr, Zi plane
Zi, Ci plane

The source is as follows:

    for (Cr = -2; Cr < 2; Cr += increm) {
      maxCi = (float)Math.sqrt(4 - Cr * Cr);
      for (Ci = 0; Ci < maxCi; Ci += increm) {        
        ZrAux = Zi = n = 0;
        while (n < maxN) {
          Zr = ZrAux * ZrAux - Zi * Zi + Cr;
          trayectoria[n][1] = Zi = 2 * ZrAux * Zi + Ci;
          trayectoria[n++][0] = ZrAux = Zr;
          if (n == limiteN) {
            x = trayectoria[limiteN - 1][0];
            y = trayectoria[limiteN - 1][1];
            for (j = limiteN - 2; j >= 0; j--) 
              if (x == trayectoria[j][0] && y == trayectoria[j][1]) j = -1;
            if (j == -2) break;
          }
          if (Zr * Zr + Zi * Zi > 4) break;
        }  
        if (n == limiteN || n == maxN) for (n--, i = 0; i < n; i++) {
          coordX = (int)((trayectoria[i][0] + 2) * factor);
          coordY = (int)((trayectoria[i][1] + 2) * factor);
          pixels[coordX][coordY]++;
          pixels[coordX][ladoImgAux - coordY]++;
        }
      }
    }
Primitive Buddhabrot

In 1988, a scientist named Linas Vepstas tried out different Mandelbrot renders; amongst them was what I call the "primitive Buddhabrot": the technique consisted on painting all trajectories -regardless of C being in or outside of M. The result, logically, is the same as merging the Buddhabrot with its negative. A few years later, in 1993, Green came up with the Buddhabrot technique, and hung it on Usenet for everyone to see.

Vepstas, among many other things, has created a truckload of fractal images, so it's worth it to take a look at his galleries; the one most related to the Buddhabrot is called "The interior Mandelbrot room".

The code for this render is:

    float inc;

    for (Cr = -2; Cr < 2; Cr += increm) {
      maxCi = (float)Math.sqrt(4 - Cr * Cr);
      for (Ci = 0; Ci < maxCi; Ci += increm) {        
        ZrAux = Zi = n = 0;
        while (n < maxN) {
          Zr = ZrAux * ZrAux - Zi * Zi + Cr;
          trayectoria[n][1] = Zi = 2 * ZrAux * Zi + Ci;
          trayectoria[n++][0] = ZrAux = Zr;
          if (n == limiteN) {
            x = trayectoria[limiteN - 1][0];
            y = trayectoria[limiteN - 1][1];
            for (j = limiteN - 2; j >= 0; j--) 
              if (x == trayectoria[j][0] && y == trayectoria[j][1]) j = -1;
            if (j == -2) break;
          }
          if (Zr * Zr + Zi * Zi > 4) break;
        }  
        // The Buddhabrot is more relevant than the negative.

        if (n == limiteN || n == maxN) inc = .01f;
        else                           inc = 1;
        for (n--, i = 0; i < n; i++) {
          coordX = (int)((trayectoria[i][0] + 2) * factor);
          coordY = (int)((trayectoria[i][1] + 2) * factor);
          pixels[coordX][coordY] += inc;
          pixels[coordX][ladoImgAux - coordY] += inc;
        }
      }
    }

And the images for the 6 capital planes:

Zr, Zi plane
Zr, Cr plane
Zr, Ci plane
Cr, Ci plane
Cr, Zi plane
Zi, Ci plane

Well that's all there is to it for the article. I hope you have at least enjoyed the spectacular images and animations; they're all collected at the gallery, plus a few extra ones. Oh, and don't forget to check out the applets -one to rotate the Buddhabrot through the 4 dimensions, and another one to get zoomed images fast.

To wrap it up, thanks to those who have contributed to the investigation of the Mandelbrot set and the Buddhabrot: Benoît Mandelbrot, Linas Vepstas, Lori Gardi, Robert P. Munafo, etc. -their work has been my source of inspiration. Special thanks to: my dad, who's tipped me off on some of the trig formulae for the animations and the 4D applet; and Melinda Green, who's given me some good ideas for the site.

 
Copyright © Albert Lobo Cusidó 2006-2014