### Mandelbrot set

The Mandelbrot set and its complex beauty.

# Formula At its simplest, the Mandelbrot set is defined iteratively by the following formula:

`z_(n+1) = (z_n)^2 + c`

# Generation The rules for generating the Mandelbrot set are surprisingly simple; we begin by defining the following three constants:

`W` = the width of the plane`H` = the height of the plane`Z` = the zoom factor

Then for each value of `x={1,2,...,W}` and `y={1,2,...,H}`, we create a complex number `c` as following:

`c = (2x - W) / (W*Z) + ((2y - H) / (H*Z))i`

The value of `c` is then assigned to a new variable, called `z_1`, as:

`z_1 = c`

Then we define a new constant, called `I`, which represents the total number of iterations that we want to perform (usually, in the range `[30,150]`).

`I = 100`

Then we choose a limit `L`, which will stop the iteration early if a certain value `|z_n|` (where `1 <= n <= I`) exceeds the value of `L`.

`L = 2`

Now we can begin the iteration, with `n={1,2,...,I}`.

`z_(n+1) = (z_n)^2 + c`

A…

# Formula At its simplest, the Mandelbrot set is defined iteratively by the following formula:

`z_(n+1) = (z_n)^2 + c`

# Generation The rules for generating the Mandelbrot set are surprisingly simple; we begin by defining the following three constants:

`W` = the width of the plane`H` = the height of the plane`Z` = the zoom factor

Then for each value of `x={1,2,...,W}` and `y={1,2,...,H}`, we create a complex number `c` as following:

`c = (2x - W) / (W*Z) + ((2y - H) / (H*Z))i`

The value of `c` is then assigned to a new variable, called `z_1`, as:

`z_1 = c`

Then we define a new constant, called `I`, which represents the total number of iterations that we want to perform (usually, in the range `[30,150]`).

`I = 100`

Then we choose a limit `L`, which will stop the iteration early if a certain value `|z_n|` (where `1 <= n <= I`) exceeds the value of `L`.

`L = 2`

Now we can begin the iteration, with `n={1,2,...,I}`.

`z_(n+1) = (z_n)^2 + c`

A…