Fractals

February 18, 2018

Fractals are freaking sweet. They are infinitely complex and yet can be described using relatively simple mathematical equations.

Fractals are made, basically, by taking a specific equation and solving it a number of times. The more times you solve it, the more complex the surface looks and the “deeper” you can zoom. The equation below, for instance, is used to make the Mandelbrot Set, which is probably the most famous fractal. The variables c and are complex coordinates, i.e. they have “real” and “imaginary” components. And so the Mandelbrot set is plotted on the complex plane. The number of iterations, n, can also be considered the “depth”, or complexity, of the fractal.

Honestly, it’s really hard to wrap your head around how this equation works. I programmed it myself in Python, and I still don’t fully understand it. Basically, for every spacial coordinate, you iterate this equation until it diverges, and then color it based on the number of iterations to get there. The images below illustrate how the depth, n, affects the appearance.

n = 10
n = 15
n = 25 

And here’s a video illustrating the same concept.

And another one.

And here’s another demo video, where the depth of the fractal is programmed to sync with the beat of the music. I also added 8-fold symmetry. Check out my earlier blog post to learn more about syncing music to visuals. Download the track here.

Fun fact, I programmed the expanding circles using a phase-field code that I worked on in grad school. Phase-field codes are used to simulate how phases or grains evolve in materials when you heat them up. You can read ​my PhD thesis here, if you feel like it, but I don’t recommend it.

Love,
Anthony / Trazer

[jetpack_subscription_form title=”Subscribe to my blog <3″ subscribe_text=”Enter your email to receive notifications of new blog posts! (you may need to check your SPAM filter for your initial confirmation email)” subscribe_button=”Subscribe” show_subscribers_total=”0″]