Screens of fractals and complex numbers

12 min read

CLASSIC DEMOS

Blowing our minds and eyes with his psychedelic demos, it looks like Ferenc Deák has a rising medical bill to pay…

Last month, we introduced some basic movement on to the screen, with the famous L stretching-scrolling Star Wars effect, and with it also came the notion of the texture. Intentionally focusing on the educational aspect of the article, we have concocted a very suboptimal texture format, but one that is very easy to understand for beginners, too.

First we’re introducing some wondrous concoctions known as fractals, and we will draw and zoom them around the screen. For the second part of this month’s tutorial, we are focusing on some stunning effects in order to demonstrate how clever texture manipulations can create some unexpected results. One of them is the rotozoom effect (an effect that rotates and zooms in and out) and the next one is the famous tunnel effect, which gives the viewer the illusion of flying through a tunnel.

But before we delve into more details for these effects, we need to lay the mathematical foundation used in implementing them. So dear reader, please head over to our boxouts and read upon a bit on the dark art of trigonometry and the mysterious concoction of complex numbers. Because we will use both of those notions heavily in this episode.

Biting our own tail

Fractals are intricate and self-replicating geometric patterns characterised by self-similarity, where parts of the structure resemble the whole at different scales. Generated through iterative processes or mathematical equations, fractals exhibit infinite detail and complexity emerging from a simple formula. They are found in nature, from clouds and mountains to biological structures, such as the pattern found on trees or ferns (Polypodiopsida, for lovers of Latin names). Fractals play a prominent role in computer graphics, art and scientific simulations, with examples such as the Mandelbrot set and the Julia set showcasing their visually captivating and mathematically intriguing properties.

The beauty of the Mandelbrot set lies in its intricate and self-replicating patterns, which can be explored at various levels of magnification limited only by the capabilities of the hardware. There are several sections that you can discover in the set, after zooming into various areas:

The seahorse valley in the Mandelscape.

• Mini Mandelbrots (Mandelbabies): At various zoom levels, you can find smaller replicas of the entire Mandelbrot set within the set itself, and at deeper zoom levels, these babies are rotated with various ang