My Journey into a World of Fractals
It was many moons ago when I was a maths student that I first laid eyes on images of the Mandelbrot and Julia sets, and became aware of fractals.
Both the word and the idea were new to me. And what fascinated me as much as the infinite detail was that it seemed astounding that even the intricate and convoluted structure of the boundary of the Mandelbrot set could be produced from such a simple function as f(z):z → z2 + c. In the world of real numbers one expected a simple second order polynomial to produce a smooth curve. It seemed, though, that moving from the real line into the complex plane produced entirely different behaviour. And then, of course, there's the question of iteration, that's the key to the intricate and infinite detail present in many "escape-time" fractal images.
It was many years later that I began to think about writing my own program to produce images of the Mandelbrot and Julia sets. At first it was really an exercise to see how well I'd mastered Java, but also because I'd always been fascinated by the patterns inherent in life, in the natural world, and in mathematics. I knew it would bring me joy if I could create a coloured picture of a Julia set merely by writing some mathematical code.
I have a clear memory of the moment my first Julia set appeared on the screen. I experienced intense joy. And I guess it was that joy which was the beguiling feeling that led me on a journey into the world of fractals.
To be continued...
How it works
In this simple case, how do we proceed? Well, we iterate this simple function, again and again and again, each time taking the output and putting it back as the input. Strangely, though, we're not interested in the precise value of the function each time we apply it. All we do is take whatever value it produces and apply the function to that. And we carry on doing that until either the value produced goes outside a certain range (which we can predefine) or we've done a given number of iterations (which we can also predefine).
We might decide that we'll do a maximum of 32 iterations and we'll stop iterating if the value goes outside a circle of radius 4 centred on the origin (remember we're in the complex plane). A number z = x + iy is outside the circle if and only if x2 + y2 > 16, so we can easily test for this.
Finally, Ian's Crazy Zebra Cat mutates...(or: Cat, Couch, Camera, Calculations!)
To be continued...