# Difference between revisions of "Fractal Computation in ChucK - The Julia Class"

Line 13: | Line 13: | ||

The equation for the Julia set is: | The equation for the Julia set is: | ||

− | '''Z<sub>n+1</sub> = Z<sub>n</sub>< | + | '''Z<sub>n+1</sub> = Z<sub>n</sub><sup>2</sup> + c''' |

Fractals are drawn in the complex plane (thus points in the plane will take the form '''z = a + b''i'''''). For the equation above, this means that the Z_n | Fractals are drawn in the complex plane (thus points in the plane will take the form '''z = a + b''i'''''). For the equation above, this means that the Z_n | ||

== DESIGN == | == DESIGN == |

## Revision as of 23:35, 9 December 2008

## IDEA

To create a class that utilizes proper fractal computation as a means for generating a well-defined array that, in use, sounds random or chaotic but is entirely deterministic and thus perfectly repeatable, while still containing more varied content than a standard recursion function.

## FRACTALS?

A fractal is a geometric shape that, when split into parts, will look approximately (or exactly, if framed perfectly) like the whole. Some can even be scale-invariant. They are 'produced' through iterations of an equation. The recursion is what produces the self-similarity.

The two most popular set of fractal-generating processes are known as the Julia set and the Mandelbrot set. While both produce fractals that are infinitely complex, the Julia set allows for much more variation in the resultant fractal with very small changes in the constants given (it is more chaotic).

The calculation of the shape is fairly simple, but requires a few inputs. It takes a recursive equation and plots the number of iterations necessary at each point before the equation hits a max value (generally seen to be when it's growth will become wildly exponential). Since some points will only reach this value after an infinite number of iterations, the calculation will either stop at the max value or at a given max number of iterations.

To make the calculation, then, we need to give it: an equation, initial constants, max output, max number of iterations, plot boundaries and plot grid density (the plot's subdivisions; ie, how many points to begin iteration at).

The equation for the Julia set is:

**Z _{n+1} = Z_{n}^{2} + c**

Fractals are drawn in the complex plane (thus points in the plane will take the form **z = a + b i**). For the equation above, this means that the Z_n