In this repo you will find all the codes developed during the fract'ol project, both mandatory's part and bonus.
This project’s goal is to create a small fractal exploration program. Start by seeing what a fractal is. The constraints are as follows:
• Your software should offer the Julia set and the Mandelbrot set.
• The mouse wheel zooms in and out, almost infinitely (within the limits of the computer). This is the very principle of fractals.
• You must use at least a few colors to show the depth of each fractal. It’s even better if you hack away on psychedelic effects.
• A parameter is passed on the command line to define what type of fractal will be viewed. If no parameter is provided, or if the parameter is invalid, the program displays a list of available parameters and exits properly.
• More parameters must be used for fractal parameters or ignored.
• You must be able to create different Julia set with the parameters of the program.
As for the graphic representation:
• ESC will exit the program.
• The use of images of the minilibX is strongly recommended.
• One more different fractal (there are more than a hundred different types of fractals
referenced online).
• The zoom follows the actual mouse position.
• In addition to the zoom: moving with the arrows.
• Make the color range shift.
Fractal is a word coined in 1975 by Benoit Mandelbrot. It is derived from the Latin "fractus", which means crushed, broken, broken.
In the language of mathematics, a fractal is a set with the property of self-similarity. In other words, each element of the set is an exact or approximate copy of the whole.
It seems that this is a purely mathematical concept, but in reality we are faced with fractals every day. Trees, mountains, plants and even the circulatory system have a fractal structure.
As is known from the course of geography, each of the countries has its own area of territory and the length of the border. If a country is washed by any sea or ocean, then it also has a maritime border. But how do you determine the length of these borders?
In 1967, Benoit Mandelbrot asked himself the following question: "What is the length of the coastline of Great Britain?"
It turned out that it is impossible to correctly answer this seemingly simple question.
The length of the coastline can only be measured approximately. As the scale decreases, more and more small capes and coves need to be measured. And since there is no limit to zooming out, there is no limit to the length of the coastline. That is, it is endless.
The English mathematician Lewis Fry Richardson faced the same paradox in 1951 when he noticed that Portugal had defined its land border with Spain at 987 km, while Spain, in turn, at 1214 km.
The solution to this problem is possible by setting the minimum segment. For example, if the length of the coastline is measured in kilometers, then small bends that are less than one kilometer long are not taken into account.
Once mathematicians were faced with equations that could not be solved using ordinary numbers:
The equation
To fix the problem and still find the root of the equation, they came up with a number i, which they called the imaginary unit.
They also declared that this number is equal to the square root of minus one:
imaginary unit
The square of this number, respectively, is equal to minus one:
Imaginary unit squared
Thanks to the imaginary unit, the solution of such equations became possible:
Equation solution
This is how complex numbers appeared, in which, in addition to the normal, understandable part, there was also an incomprehensible one, where there is i:
Complex number
It turns out that a complex number zconsists of two parts: ait is called the real part (real part), and b- the imaginary part (imaginary part) of the complex number.
We have already worked with the plane. Points were marked on it using a pair of numbers xand y.
But what is the complex plane and where can I get it?
To get a complex plane, you just need to carry out a small “rebranding” of the familiar plane: replace the axis xwith the axis re(real part), a ywith im(imaginary part).
Any complex number can now be marked on the resulting plane, because it also consists of two components ( re, ), just like the coordinates ( , ) already familiar to us :x y