(DRAFT) Assignment: Mandelbrot Visualizer

[ICO]NameLast modifiedSizeDescription

[PARENTDIR]Parent Directory  -  
[   ]mandelbrot.tar.gz2026-04-10 09:33 3.1K 
[IMG]sample.webp2026-04-08 15:12 1.2M 

Background

The Mandelbrot set has a simple definition that when visualized on the complex plane, results in high emergent complexity. As you can see in the animation on the right, you can zoom into any region — and if you choose a random region on the boundary, you are probably the first (and last) human to have ever seen it.

The definition of the Mandelbrot set are all complex coordinates c, where the derived sequence

z n + 1 z n 2 + c z 0 0

(Recall how multiplication of complex numbers works, to understand why this doesn't trivially diverge for all values: complex multiplication is akin to a rotation that can result in a cycle.)

Implementation

When computing the Mandelbrot set, we approximate divergence negatively by the number of iterations i we can take without the sequence diverging. Additionally we will bound the computation to some fixed number n, and visualize the point (i.e. pixel) on the complex plane by picking a color from a color gradient (in our case grayscale) proportional to i / n . All of this has already been implemented in the template.

Problems such as Mandelbrot are referred to as embarrassingly parallel, since divergence can be approximated independently for each point. Nevertheless, an efficient computation requires some thought — do not just start a new process for each pixel, since determining divergence takes much longer on some parts of the plane than on others.

Overview of what to do?