Skip to content

A simple computer graphics program to show the beauty of fractals.

Notifications You must be signed in to change notification settings

andreabertolini1995/fract-ol

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Fract-ol

This project is about creating a simple computer graphics program to show the beauty of fractals.

What is a fractal?

A fractal is an abstract mathematical object, like a curve or a surface, which pattern remains the same at every scale.

To understand what fractals are all about, we need to take a step back and dive a little bit into the world of complex numbers.

Let's consider a point A and a constant c in the complex plane, as well as the generic function $f(z) = z^2 + c$. Let's now imagine to apply this function to the point A and iteratively apply the same function to its result, again and again, for let's say about 100 iterations.

It's very interesting to see that for some values of c the iteration converges, while for others it diverges to infinity at different speed. In the following example, A is set to 0.4 + 0.4i.

julia_set.mov

When iterated from A = 0, the set of complex numbers c for which the function $f(z) = z^2 + c$ does not diverge to infinity is called the Mandelbrot Set.

On the other hand, for a given complex number c, the Julia set of c is the set of all A for which the iteration $f(z) = z^2 + c$ does not diverge to infinity.

Particularly interesting to see are the boundaries of the different Julia sets for a given value of c, i.e. the perimiter in the complex plane outside which the iterations diverges to infinity.

julia_set_boundaries.mov

Within the scope of this project, it was required to display the Mandelbrot set as well as any possible Julia set, given a different value of the constant c as input.

Run the code

To run the algorithm, it is first needed to clone the repository, move the its directory and then execute the Makefile.

git clone https://github.com/andreabertolini1995/fract-ol.git
cd fract_ol
make

Then, you can launch the executable followed by the name of the fractal you want to display. With the mouse wheel you will be able to zoom in and out almost infinitely (within the limits of the computer).

./fractol mandelbrot
mandelbrot.mp4

For the Julia set, it is required to specify the complex coordinates of the constant c.

./fractol julia 0.285 0.01
julia.mp4

About

A simple computer graphics program to show the beauty of fractals.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published