top of page

Fractals 

I became obsessed with fractals when one of my professors in Architecture school showed me a mandelbulb for the first time. Ever since then, I've tried to put aside a little bit of time every year to do more research on fractals. I have collected a ton of information over the years, but have barely scratched the surface.

This journey all started with trying to recreate a mandelbulb of my own. At the time I had a decent enough knowledge of Python to be try some Vex scripts. So, I took on the challenge.

The mandelulb you see to the right was made mostly from a Vex python script, and volumes. 

This is all cool and dandy, but . . .

wtf is a fractal?

The Simple Explanation:

 

A fractal, or the mandelbrot set, is an infinite pattern literally defined as Z ⇋ z^2 + c. When running this equation on a computer this image is created:

Fig. 1: Mandelbrot set (Lesmoir-Gordon, Clarke and Mandelbrot, 2010)

The Complex Explanation:

 

To start, let’s break down this equation:  Z ⇋ z^2 + c (Lesmoir-Gordon, Clarke and Mandelbrot, 2010). The z’s and c in the equation are just numbers, float numbers. Which is different from most other equations, where the variable’s would be a constant like Energy, or Speed, etc. These numbers just define points on a 2 dimensional grid in the x and y axis. The equation is used to describe how these points move to create a shape. The double arrow equals symbol means that the equation is iterative. Numbers flow in both directions, and are directly related to each other. So, basically the equation is a loop, once started, it will never end. 

 

Any human in the world would be able to draw these points if they kept plugging in random numbers. The problem is, no human would live long enough to draw every point, because there are infinite points. 

The next best thing we have to a human, is a computer, and this is where we run the equation. It is physically impossible to run these numbers by hand so we use a computer to calculate everything for us. 

 

The computer runs the equation by defining the output numbers as blips on a coordinate plane. ‘c’ is defined as the starting point, or zero point on the x y plane. ‘z’ is the initial range of the blip from starting point ‘c.’ Big ‘Z’ is the final destination of the blip relative to starting point ‘c.’(Lesmoir-Gordon, Clarke and Mandelbrot, 2010)

 

The computer plots all these blips on the screen for us humans to see, and it creates this shape I mentioned before:

Fig. 1: Mandelbrot set (Lesmoir-Gordon, Clarke and Mandelbrot, 2010)

Now, what’s with the colors, and why is the middle black?

 

The colors have no other meaning other than to help the viewer visualize depth, like a topographic map. This diagram may help you understand better:

Fig. 3: Mandelbrot ‘escape time’ diagram (Lesmoir-Gordon, Clarke and Mandelbrot, 2010)

The color gradient can be black and white, white and red, red and blue, etc. This gradient is called the ‘escape time’(Lesmoir-Gordon, Clarke and Mandelbrot, 2010, page 27). It can only be seen as a 3 dimensional shape if the mandelbrot set was projected onto an x y z plane. Like I said before, it’s very similar to contours on a topographic map. It shows z-depth. 

 

The black inside of the shape is used to describe the blips in the equation that are equal to 0. The ‘line’ bordering the black inside are blips that are equal to 1. Everything else in the shape is a number greater than 1, growing or falling into infinity. 

 

The law of squares helps us understand how this all works in the mandelbrot set equation 

Z ⇋ z^2 + c :

 

1. if the input z is exactly equal to 1, the output Z always remains 1; 

 

2. if the input is more than 1, the output eventually becomes infinite; and 

 

3. if the input is less than 1, the output eventually becomes zero.

 

(Lesmoir-Gordon, Clarke and Mandelbrot, 2010, page 28)

 

This relatively concludes the answer to the question ‘What is a Fractal?’ Obviously I can go into very intense theoreticals and possibilities about the mandelbrot set, but for the most part this will help you understand the basics of fractals.

Dope! but uhh . . .

wtf is a Mandelbulb?

Well, the Mandelbulb is the next step in evolution for 2D fractals or the Mandelbrot set. 

 

The mandelbrot set is defined as: Z ⇋ z^2 + c

 

On the most basic level, a mandelbulb is a 3D fractal object. It utilizes the same mandelbrot set equation to create its 2D shape, but is then projected into 3D space using a modified algorithm. 

 

The mandelbulb wasn’t discovered until 1997, by Jules Ruis. It was initially created as a computer program called ‘BBM-15.exe’(Ruis, 1997). He developed this program so anyone can create their own mandelbulb using the equations. There isn’t a lot of information on how he came up with this equation, but from what I can tell, he replaced the two-dimensional variables ‘Z’ and ‘c’ in the mandelbrot set with numbers representing blips in an x,y,z plane.

 

If you’re really that curious, like me, this is the modified algorithm:

{x,y,z} ^n = (r^n) { cos(n*φ) * cos(n*θ), sin(n*φ) * cos(n*θ), sin(n*θ)}

Fig. 4: Mandelbulb (Ruis, 2012)

where r = sqrt (x^2 + y^2 + z^2) and r1 = sqrt (x^2 + y^2) 

As we define θ as the angle in z-r1-space and φ as the angle in x-y-space then θ = atan2 (z / r1) so θ =

atan2 (z / sqrt (x^2 + y^2)) and φ = atan2 (y/x) 

The addition term in z -> z^n + c is similar to standard complex addition, and is simply defined by:

(x,y,z} + {a,b,c) = {x+a, y+b, z+c} The rest of the algorithm is similar to the 2D Mandelbrot!

(Ruis, 2012)

To this day, the mandelbulb is still being studied. Like the mandelbrot set, the mandelbulb is truly infinite, but also infinitely more complex. Not many computers can handle the 3D algorithm, or even visualize the numbers so that we can understand them.

This brings me to the Mandelbulb I mentioned in the very beginning. I made it without knowing much about fractals and how they work or where they orginiated from. Now with all this new found knowledge I can appreciate my creation a little more. 

How did I make my own Mandelbulb?

The entire process was done in Houdini Side FX. At a first glance it seems very complex, but you can honestly create a mandelbulb with just two nodes, and a vex expression.

All you need is a volume node, and a volume wrangle node. Plug the vex expression below into the volume wrangle node and you'll see your mandelbulb within a few seconds. 

VEX Expression:

float x=0, y=0, z=0, xnew, ynew, znew, n=ch( 'n'), r, theta, phi;

    int i;

    

    x = x0;

    y = y0;

    z = z0;

    

    for(i=0; i < imax; i++){

        //xnew = x*x - y*y + x0;

        //ynew = 2 * x * y + y0;

        

        r = sqrt(x*x + y*y + z*z );

        theta = atan2(sqrt(x*x + y*y) , z);

        phi = atan2(y,x);

        

        xnew = pow(r, n) * sin(theta*n) * tan(phi*n) + x0;

        ynew = pow(r, n) * cos(theta*n) * cos(phi*n) + y0;

        znew = pow(r, n) * cos(theta*n) + z0;

        

        if(xnew*xnew + ynew*ynew + znew*znew > 10){

            return(i);

        

        }

        

        x = xnew;

        y = ynew;

        z = znew;

    }

    return(imax);

}

 

//--- Main ---

 

int maxiter = 16;


 

if(Mandel(@P.x, @P.y, @P.z, maxiter) <maxiter){

    @density = 0.0;

}

else {

    @densty = 1.0;

 

}

The Mandelbulb will be represented as a volume so if you want to create a geometry you may want to create a volume bound, a peak, and a convert vdb to polygon. The volume bound will limit the extents of the volume to a certain boundary. The peak sets the edge of the boundary. 

 

'N' is the modifier that changes the shape of your mandelbulb. Basically it changes the amount of 'folds' the mandelbulb will have. I wouldn't really boost this number past 10, or your computer will crash. 

You can change pretty much modifiy everything in the VEX to fit your needs. I switched the trigonometry functions around in the 'xnew', 'ynew', and 'znew,' and that helped give me some interesting fractal variations. 

You can modify the VEX expression as much as you like. The limits are literally infinite. Well ... you may run out of computing power, but other than that the limits are infinite :). 

Exploration of Fractals and Nature

Fractal-like patterns can be found all over our natural world. Whether they be within a single celled organism, or a vast landscape, they are very evident. For all we know, the mandelbrot set can be found within our cells, or atoms. Our universe could be a mandelbulb, infinitely expanding beyond our human comprehension. Never before have humans discovered something that can be truly infinite. It is a groundbreaking event that is somewhat overlooked, and underwhelmed. 

 

There are very few people like me who get excited about the mandelbrot set, and mandelbulb. In most cases I have actually found that people get scared when this topic of infinity is brought up. It is a very profound subject to wrap our tiny little brains around. But, if you accept the fact that we actually know nothing about our reality, you can then let your mind free and fall in love with the unknown. 

The first image shown at the right is a fractal generated in a computer. The computer was told to create a set of lines that change direction and length every so often, according to its input equation. The fractal equation is fairly simple,

with only two generations of fractals. These generationslook strikingly familiar to trunks of a tree. The subsidiary fractals even look like branches and leaves. 

 

Even though the first image looks like a tree, it’s a bit too perfect and symmetrical. So, to resemble nature more accurately we can modify the equation to change the direction and length of the first trunk. Now, we have something that looks even more like a tree. 

 

But remember, these are just computer generated images.

Figure 5 and 6: ‘Tree-like’ Fractal generations

(Lesmoir-Gordon, Clarke and Mandelbrot, 2010, page 156)

Figure 7, 8, and 9: Fractal fern, human circulatory system, and brain nerve cells. (Lesmoir-Gordon, Clarke

and Mandelbrot, 2010, page 163)

This is a smaller example of a natural phenomenon, a fern. A plant that is much smaller than a tree that can hold an infinite world of fractal patterns. Each branch of a fern is a smaller fern, and each leaf of that branch is a smaller fern. At the end of the day, a fern is basically a fractal. But, again, like I said before, this image is made within a computer using a simple algorithm. 

If we dive even deeper into natural phenomena, we can find ourselves looking into our own bodies. Things such as the circulatory system or the interlocking nerve cells within our brains all resemble fractals. 


 

Is the human mind and body just a series of fractal equations? 

 

Is the earth just a set of procedural patterns? 

 

How different are we really to a set of math equations?

The Future of Fractals

Fractals may have single handedly changed the way we see the world. Fractals are truly the only infinite thing we know of currently. We have guesses about the universe being infinite, but still not sufficient evidence to support the idea. But then are fractals, a thing we have little knowledge of other than that they are infinite. 

 

How does this help us though? We get it! Fractals are infinite…who cares. 

 

Well you should care, because fractals have already been implemented into more technology than you may know of. 

 

With the discovery of fractals, scientists and mathematicians now have a new way of looking at their calculations. They can run their calculation through infinite fractal proofs, They can even define their equations as fractal shapes, or compare their microscopic discoveries to the geometry of fractals. 

 

Fractals can also be used as a secondary form of research, or proofing of theories. This idea can benefit medical researchers, especially those working with medical imagery. Or it can benefit computer programmers developing new software for procedural based workflows. 

 

Procedural pipelines would have never been as efficient without the discovery of fractals. Many coding languages work based on these infinite loops that proof each other, which ultimately allows us to control our past in 3D software. 

 

Fractals have even been used as the bases of a coded program itself. Certain modern day image compression would not have been made without fractals. 

 

Fractal image compression was invented by Michael Barnsley in 1987, but was not commercially sold as a software for consumers until 1992. (Texas Instruments Europe, 1997). This compression scheme works by using fractal geometry to compress high resolution digital images, or increase resolution of low quality digital images. There is a load of equations that are involved in this compression process, but that is the basis of the idea. 

 

Other image compression exists, such as JPEG image compression. The difference between the JPEG and FIF(Fractal Image Format) is that JPEG uses 2D sine waves to produce smaller blocks of the previous larger image in order to compress the file. (Texas Instruments Europe, 1997)

.

 

JPEG image compression is known to produce good results, but is also known to be less precise than FIF compression. (James, 2013). The two main problems with JPEG image compression are that one: wherever there are disconnects in the image, such as blocks from white to black, the sine waves would simply not be able to compress it properly and would result in less curves in your image. 

 

And two: JPEG compression is scale dependent. Meaning when you scale up your compressed image you obviously lose that quality you previously had. 

 

These two problems do not happen with FIF compression. Fractal image compression is infinite. Meaning you can compress any image, scale it up, and it will continue to produce new artificial pixels to keep the quality of the image. It can also keep the curves of the previous image no matter how compressed the image gets.

 

It’s infinite image compression! 

 

The only problem with it is that it isn't that efficient of a compression scheme as compared to JPEG. But, it still has practical applications in the medical field as well as the security industry. For the reason that you can infinitely zoom into images and still retain their quality. 

 

Like I said much earlier in the paper, we don’t really have the computational power to utilize the power of fractals. Though, in time we will. I'm sure of it. And when that moment comes it may change the way we use our computers.

Conclusion

Fractals have a very bright future ahead for themselves. At the moment humans can’t properly take advantage of them due to their infinite like nature. But, we will eventually. It’s not like they are going to disappear…they literally cannot disappear. 

 

That idea of infinity still raises a lot of questions:

 

Is our universe just a fractal?

 

Are humans made of fractal systems?

 

Is the earth just made up of fractal geometries?

 

Are we just living in a huge computational fractal?

 

Of course these are just some introspective questions. But, the real world is fairly finite, from what we can tell so far. Everything has an end, or what we can currently perceive as an end…

References

Lesmoir-Gordon, N., Clarke, A.C. and Mandelbrot, B.B. (2010). The colours of infinity : the beauty and power of fractals. London ; New York: Springer Verlag.

 

Ruis, J. (2012). Fractal Trigeometry. [online] Available at: http://www.fractal.org/Formula-Mandelbulb.pdf [Accessed 28 Jan. 2022].

 

Ruis, J. (1997). PRINT-OUT VAN BBM-15.exe. [online] Fractal Consultancy. Available at: http://www.fractal.org/BBM15.pdf [Accessed 28 Jan. 2022].

 

James, M. (2013). Fractal Image Compression. [online] www.i-programmer.info. Available at: https://www.i-programmer.info/babbages-bag/482-fractal-image-compression.html?start=3 [Accessed 27 Jan. 2022].


Texas Instruments Europe (1997). An Introduction to Fractal Image Compression. [online] An Introduction to Fractal Image Compression. Texas Instruments Incorporated. Available at: https://www.ti.com/lit/an/bpra065/bpra065.pdf?ts=1643314312185&ref_url=https%253A%252F%252Fwww.google.com% [Accessed 27 Jan. 2022].

Sorry :( . . . Research pages are only available on Desktop Site.

here's a cool rock.

bottom of page