Skip to content

Latest commit

 

History

History
40 lines (31 loc) · 1.34 KB

README.md

File metadata and controls

40 lines (31 loc) · 1.34 KB

Mandelbrot set visualization

1024x1024 1000

Theory

Definition

The Mandelbrot set is the set of complex numbers $c$ for which the function $f_c(z) = z^2 + c$ does not diverge to infinity when iterated from $z = 0$, i.e., for which the sequence $f_c(0)$, $f_c(f_c(0))$ , etc., remains bounded in absolute value.

Algorithm

The algorithm is based on the function

int mandelbrot(...)

which returns the number of iterations it takes to reach the critical "escape" condition. Thus, this function is run for each pixel of the image and, depending on the result of the function, each pixel is colored in shades of gray.

Installation and usage

Installation

git clone https://github.com/amamdemous/mandelbrot_set
cd mandelbrot_set/
make

Usage

Run the executable with width, height and maximum number of iterations.

Example:

./mandelbrot 1024 1024 1000

For the sake of simplicity output image is in .ppm format which can be viewed through most image viewers

Reference