Mandelbrot Set

Project files are available in the Mandelbrot GitHub repository.

A collection of small, independent C programs for rendering user-selected areas of the Mandelbrot set. The examples share the same core escape-time calculation while demonstrating several different ways to convert integer or smooth iteration counts into color.

About the project

The programs ask for the center coordinate, horizontal span, image dimensions, and maximum number of iterations, then write a 24-bit output.bmp. Pixel centers are sampled with equal coordinate spacing on the real and imaginary axes so the complex plane is not distorted.

basic.c demonstrates conventional integer escape-time coloring with an external palette file. The remaining programs use a continuous (smooth) iteration count and apply different palette formulae or color-space constructions. Points that do not escape within the selected maximum iteration count are rendered black.

The repository also contains a detailed mathematical derivation of the smooth iteration formula in README.md and an unchanged Microsoft Word version, Mandelbrot.docx.

Palette examples

Each thumbnail links to the corresponding full 3840 × 2880 example. The source link opens the C implementation in the repository.

Building and running

The repository includes a root Makefile. GCC, GNU Make, and the standard math library are sufficient.

make
./cosine

Each executable asks interactively for the region and image parameters and writes output.bmp. Remove or rename an existing output.bmp before rendering another image. make clean removes the generated executables, the root copy of the palette used by basic, and output.bmp.

To compile a smooth-coloring example individually:

gcc -Wall src/cosine.c -o cosine -lm

Interesting coordinates

These coordinates are also listed in the source-code README and provide a progression from the whole set into progressively deeper structures.

Real centerImaginary centerHorizontal spanDescription
-0.70.03.0769Whole Mandelbrot set
-0.875910.204640.53184Seahorse valley
-0.7598560.1255470.051579Spirals and seahorses
-0.743030.1264330.01611Upside-down seahorse
-0.74356690.13140230.0022878Seahorse tail
-0.74364990.131882040.00073801Part of a tail
-0.743640850.131827330.00012068Satellite
-0.7436431350.1318259630.000014628Crowns and tails
-0.7436447860.13182525360.0000029336Antenna
-0.743644099610.131826046880.00000066208Seahorse valley 2
-0.743643862690.131825902710.00000013526Spirals and seahorses 2
-0.7436439000550.1318258909010.000000049304Double spirals with satellites
-0.74364388857060.13182590431240.0000000041493Outer appendices
-0.743643887173420.131825904251820.00000000059849Double hook
-0.7436438870371510.131825904205330.000000000051299Islands

Documentation

Smooth iteration coloring presents the complete derivation as a web page with rendered mathematics.

The unchanged repository documents remain available in their original forms: README.md, Mandelbrot.docx, and src/README.md.