Buddhabrot Buddhabrot
Accelerate BuddhaZoom

Note: I've developed a technique and a quick zooming applet since I wrote this section, so part of the info presented here is now not that valuable.

Now we've got a fairly quick code, but zooming is still a drag. What can we do to get results faster?

Trajectories

Again, we have to stop and think a little. I said before that, when zooming, you have to sweep the whole plane anyway because the trajectory of a given C is chaotic and unpredictable. Not so! Chaotic, maybe, but not unpredictable -and that's the key to get fast zooming.

Based on observation, the first thing I noticed is that every minibrot tosses its trajectories in a way that'a analogous to the Buddhabrot's. In consequence, if we want to enlarge a minibrot, we only have to sweep the plane region that contains it -just like the Buddhabrot is contained in a radius 2 circle.

If you look closely, the Buddhabrot has more minibrots than the Mandelbrot. That's because every minibrot projects itself on several parts of the plane. For instance, the minibrot on the image to the left projects itself on three different places, two of which are marked on the other image.

Two projections of a minibrot

Since I'm not a mathematician, I couldn't give a precise formula to narrow down the Cs to check when zooming on the Buddhabrot. But what I can do is to propose some guidelines based on the plane regions describen on the previous page. The following images show the trajectories that each region projects.

Region 1
Region 2
Region 3
Region 4
Region 5
Region 6
Region 7
Region 8
Region 9

The idea is very simple -even crummy-: think which zone you want to enlarge, see what regions project something onto it, and discard the rest.

Mandel-BuddhaBrot transition
Buddhabrot sweep

I's quite clear that visual references -for lack of a good mathematic solution- have been fundamental. Take a look at these animations: on the first one, you can see how trajectories unfold from their point of origin, illustrating the transition from Mandelbrot to Buddhabrot; on the second, a 0.1 high bar crosses the plane perpendicular to the real axis, revealing the trajectories of the Cs it comes across.

Regarding the code, we have to make a couple of changes to the general pattern because now we're just sweeping half the plane. As for the regions selection, you'll have to do it copy-pasting the relevant bits. Remember that the deeper you zoom, the greter maxN will have to be, because the closer to the border a C (outside M) is, the more iterations we'll need to identify it.

private float[][] getPixelsZoom(int lado, int maxN, 
                                float xMin, float xMax, float yMin, float yMax) {
    // Initialize variables

    ...
    float factor = ladoImgAux / (xMax - xMin);
    
    // Region x
    ...
        for (n--, i = 0; i < n; i++) {

            if (trayectoria[i][0] < yMin || trayectoria[i][0] > yMax) continue;
            if (trayectoria[i][1] >= xMin && trayectoria[i][1] <= xMax) {
                coordX = (int)((trayectoria[i][0] - yMin) * factor);
                coordY = (int)((trayectoria[i][1] - xMin) * factor);
                pixels[coordX][coordY]++;
            }
            if (-trayectoria[i][1] >= xMin && -trayectoria[i][1] <= xMax) {
                coordX = (int)((trayectoria[i][0] - yMin) * factor);
                coordY = (int)((-trayectoria[i][1] - xMin) * factor);
                pixels[coordX][coordY]++;
            }
        }
    ...
    return pixels;
}

Some sample enlargements:

Center at (0, -1.4)
Side = .003

Zoom on the third ball on the buddha's head.

On this zone, trajectories don't wander far from their point of origin, and there's also no interference with trajectories coming from other parts of the plane. So for this image I've only had to examine twice as much area as the enlarged part.

Center at (.7075,-1.2025)
Side = .05
Center (.70845,-1.21775)
Side = .0008
Center (.70835,-1.217963)
Side = .000016
C (.70834436,-1.2179607)
Side = .00000024

This sequence represents a fairly deep zoom on the flying minibrots above the main figure's shoulder. The original coloring for each image has been manipulated in a different way.

As I said before, a minibrot projects its very own trajectories. So to create these images, I've only had to scan the part of the plane that holds the minibrot in question.

"Yeah, but I've seen the Mandelbrot and on the enlarged area there is no minibrot", a good observer will point out. True, but the thing is that those trajectories belong to a specific minibrot. "Right, but which one is it?". Well, you have to look for it, but it's a snap if you look at the animations above.

For example, for the first minibrot's zoom (on the previous sequence), I've found the original minibrot located on a square region with side .033, and center at (1.035, -.16). This minibrot doesn't only toss its orbits on the quoted region, it does so on three additional areas of the plane -giving place to what I call "ghost minibrots" r "ghostbrots"-; this is one of them, of course, portrayed in the image.

The next image is another "ghostbrot" projected by the original minibrot from the last paragraph. What's remarkable here is that this is the ghostbrot centered at the origin of coordinates; obviously, I've filtered trajectories not projected by the minibrot so as to see the ghostbrot crystal clear. Next to it, an enlargement of the same area, only this time no trajectories have been filtered out so that you can see the difference: the trajectories from the budha's head are dominant because they outnumber the minibrot's.

Center at (0,0) Side = .3
Minibrot trajectories only
Center (0,0) Side = .3
All trajectories

Alright, so after all this code optimizing and speeding up zooms, I hope waiting ages for a Buddhazoom becomes freakin' history. Now onto the fun part: to crete beautiful images. Jump to the next page if you want to see the most unusual views of the Buddhabrot.

 
Copyright © Albert Lobo Cusidó 2006-2014