Skip to content

kozlov721/Mandelbrot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

83 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mandelbrot Set Visualizer

Simple app for zooming into Mandelbrot Set.

Here are some screenshots:

No zoom No zoom

Zoomed a hundred times Zoomed a hundred times

Zoomed a million times Zoomed a million times

Zoomed a trillion times Zoomed a trillion times

The fractal is colored using this formula:

$$(r, g, b) = \frac{255}{2K} \cdot (1 - \cos(R \cdot n), 1 - \cos(G \cdot n), 1 - \cos(B \cdot n))$$ where n is the number of computed iterations before the point exceeded from the set and K, R, G, B are parameters, initialized as:

$$K = 10$$

$$R = 1$$

$$G = \frac{1}{3\sqrt{2}}$$

$$B = \frac{1}{7 \cdot 3^{1 / 8}}$$

For the formula I was inspired by this article.

How to use

Control Action Notes
w, up move up
s, down move down
a, left move left
d, right move right
j zoom in Press shift for faster zooming.
k zoom out Press shift for faster zooming.
h decrease number of iterations -5
l increase number of iterations +5
b zooms back to initial state It keeps the position and number of maximum iterations, just resets the zoom, so you can zoom in again to where you were before as long as you won't move.
r zooms back and reset the number of iterations Zooms back to the original state and also keeps the position. In addition, it resets the value of maximum iterations.
c color reset Resets K, R, G and B constants to theirs default values.
1 K = K + 0.5 Press shift for faster change. Press ctrl for decrease
2 R = R + 0.05 Press shift for faster change. Press ctrl for decrease
3 G = G + 0.05 Press shift for faster change. Press ctrl for decrease
4 B = B + 0.05 Press shift for faster change. Press ctrl for decrease
t toggle info
enter capture Saves the current part of the set as a .ppm image in 8K.

You can also move around using mouse.

Building the app (for Linux)

To build the app, simply use the provided makefile and run make. The command will create build directory with the Mandelbrot executable in it. For the compilation to work, one must have installed pgc++ compiler. Installation instructions are here.

To build the app, you alse need SFML library. It should be possible to get it easily from your system's repositories.

Usage

The default width is set to 1200 px, which is enough to look good, but not too much to run too slow. You can change the width using a command line argument. The height is computed automatically as two thirds of the width to maintain the correct ratio.

Mandelbrot [<width>]

About

Simple app for exploring the Mandelbrot Set.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published