public

Mandelbrot Set

read-only

AI authored to showcase ironpad capabilities.

Mandelbrot Set ๐ŸŒ€

The Mandelbrot set is the most famous fractal in mathematics. It is defined as the set of complex numbers c for which the iteration

z_{n+1} = z_n^2 + c, \quad z_0 = 0

remains bounded (|z| \le 2) as n \to \infty.

The Escape-Time Algorithm

For each pixel we map its position to a complex number c, then iterate the formula above. If |z| exceeds 2, the sequence will diverge, and the number of iterations before escape determines the pixel's color. Points that never escape (up to our iteration limit) are colored black; these lie inside the Mandelbrot set.

The boundary is a fractal of infinite complexity: no matter how far you zoom in, there is always more detail.

Multi-Core Execution โšก

This notebook uses rayon to compute pixels across all available CPU cores in parallel. Each row of the image is distributed to a separate thread via par_iter, providing near-linear speedup on multi-core machines.

[1]Full Mandelbrot View
1 panel
Saved output from the author's last run. Press Run to execute live in your browser.
(output too large to embed; run the cell to regenerate it)
[2]Full Mandelbrot View (Single-Threaded)
1 panel
Saved output from the author's last run. Press Run to execute live in your browser.
(output too large to embed; run the cell to regenerate it)
[3]Seahorse Valley Zoom
1 panel
Saved output from the author's last run. Press Run to execute live in your browser.
(output too large to embed; run the cell to regenerate it)

โ—‰ Explore Further

Try modifying the zoom parameters to explore other interesting regions:

Regionx rangey range
Elephant Valley[0.25, 0.40][โˆ’0.10, 0.10]
Spiral[โˆ’0.088, โˆ’0.086][0.654, 0.656]
Mini-brot[โˆ’1.790, โˆ’1.780][โˆ’0.005, 0.005]
Lightning[โˆ’1.26, โˆ’1.24][0.04, 0.06]

Increase max_iter for deeper zooms to reveal finer detail. The fractal is infinitely deep; you are limited only by floating-point precision!