Generating Fractals requires the use of functions of a complex variable.
A complex variable, denoted as z, is the sum of a real variable x and an imaginary variable yi. Thus, we have: z = x + yi
We now consider the complex plane (or Argand plane) with axis x and y (similar in structure to the Cartesian plane). In the complex plane the x axis is the real axis and the y axis is the imaginary axis.
We define a complex constant c such as c = a + bi with a and b belonging to the set of real numbers.
We assume we want to generate a fractal image of the basic complex function:
f(z) = z^2 + c -> in discrete form we have: Zn+1 = Zn^2 + c
Per the previous definitions, we have: f(z) = ((x + yi) * (x + yi)) + (a + bi)
To generate an image, we consider each point of a bounded complex plane (which is in fact the frame of the image), each point on the plane (which on the image is equivalent to a pixel) has coordinates x and y. These coordinates as well as the complex constant c are the starting parameters for f(z). For each point, we proceed to the complex calculation and get as result the complex number Zn+1. This complex number Zn+1 becomes Zn in the next iteration for that point and so on.
At each iteration, the size or norm of the complex number Zn+1 is calculated. The speed with which the norm of Zn+1 explodes to infinity is taken into consideration by an algorithm which associates to that point (pixel) a particular color. We do so with each point (pixel) of the bounded plane to obtain just one image.
If we consider a frame of size 1,000 by 1,000, we thus have 1,000,000 points (or pixels) for which the iterative process above is performed. One iteration of the basic complex function f(z) = z^2 + c requires two complex operations (multiplication and addition). To be performed, these two complex operations requires 8 real operations.
Hence, assuming the average infinity explosion rate is at iteration 400, we see that for just one image, it is required to perform:
1,000,000 * 400 * 8 = 3,200,000,000 so 3.2 billions operations.
Complex functions used by Ulysse to generate this site's galleries required over 20 real operations with an average infinity explosion rate at iteration 250.
Generating more than 500,000 pictures induced therefore over:
1,000,000 * 250 * 20 * 500,000 = 2.5E+15 real operations
Copyright 2013 Quantsun. All rights reserved.