Skip to content

bftelman/mandelbrot_set

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Mandelbrot set visualization in C language

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published