Fract-ol is a computer graphics exploration project centered around the beauty and complexity of fractals. Using the C programming language and the MiniLibX library, this project aims to render stunning visual representations of the Julia and Mandelbrot fractal sets. It serves as a practical application of complex numbers, computer graphics optimization, and event handling in graphics programming.
To install Fract'ol, clone the repository and compile the source code using the provided Makefile.
git clone [repository-link]
cd fractol
make
Ensure that the MiniLibX library is installed on your system before compiling.
Run the program with the following command:
./fractol [fractal-type]
Replace [fractal-type] with either 1
Mandelbrot or 2
Julia to view the respective fractal set.
In mathematics, there are many different types of geometry, each exploring shapes and dimensions in unique ways. Among these, fractal geometry is one of the most intriguing.
Fractal Geometry deals with shapes that look similar at any scale. This means that if you look at a small part of the shape, you will find it resembles the entire shape. Imagine a tree, where the smaller branches branch out in a way that mimics the whole tree. Fractals are not just beautiful drawings; they are crucial in science and mathematics to understand complex patterns in nature.
Among the most famous fractal sets are the Julia and Mandelbrot sets:
- Julia Set: Known for its complexity and beauty, it consists of points that generate complex fractal shapes when certain mathematical operations are applied to them.
- Mandelbrot Set: Recognized for its distinctive shape, it is a complex example of fractals, representing a set of points in the mathematical space that exhibit repeating patterns when magnified.
Set is a collection of elements with a common defined property.
In most sets, some numbers are included while others are excluded.
Consider the set of even numbers: S = {...,-2,0,2,4,6,...}
, negative numbers: S = {...,-3,-2,-1,-1,-1/2,-1/4,...}
The set of all numbers (c) for which the sequence Z_n
remains small according to this formula:
Example 1: Is the number 1 part of the set? c = 1
Untitled.project.mp4
Is Z staying small: NO its getting big its getting very fast so is the number 1 part of the Mandelbrot set. answer is NO
Example 2: Is the number -1 part of the set? c = -1
Untitled.project.mp4
The Mandelbrot set also includes the complex and imaginary numbers
[+]² = [+]
[-]² = [+]
0² = 0
[i]² = [-] : not positive not negative and not zero : that's an imaginary number
https://plus.maths.org/content/what-mandelbrot-set
Complex Numbers are numbers that combine real and imaginary parts. A complex number is written as a + bi
, where:
a
is the real part.bi
is an imaginary part.i
is the imaginary unit, defined as the square root of -1, soi^2 = -1
.
https://www.mathsisfun.com/numbers/complex-numbers.html
- Black: belnog to the mandelbrot set
- Color: they dont
- Shade: if the sequence of Z gets really big really fast
- brighter: if Z gets big but it does so slowly
- Choose a complex number
c
. - Start with
z_0 = 0
. - Repeatedly apply the formula:
z_{n+1} = z_n^2 + c
. - If the magnitude of
z_n
(|z_n
|) remains less than or equal to 2 after many iterations, thenc
is part of the Mandelbrot set. - If |
z_n
| exceeds 2 at any step,c
is not part of the Mandelbrot set.
https://www.geogebra.org/m/jcpvtkhz
- Choose a fixed complex number
c
. - Choose
z_0
as your starting point. - Repeatedly apply the formula:
z_{n+1} = z_n^2 + c
. - If the magnitude of
z_n
(|z_n
|) stays less than or equal to 2 after many iterations, thenz_0
is part of the Julia set. - If |
z_n
| exceeds 2,z_0
is not part of the Julia set.
Note: In these formulas, z_n
and c are complex numbers, and z_{n+1}
represents the complex number obtained after applying the formula to z_n
.
- How to Generate Fractals? ⭐️
- The Mandelbrot Set - Numberphile ⭐️
- The Mandelbrot Set ⭐️
- The Secret Code of Creation - Dr. Jason Lisle ⭐️
- Geometer Explains One Concept in 5 Levels of Difficulty | WIRED
- From Newton’s method to Newton’s fractal (which Newton knew nothing about)
- Beyond the Mandelbrot set, an intro to holomorphic dynamics
- What is fractal geometry? │ The History of Mathematics with Luc de Brabandère
- What Is A Fractal (and what are they good for)?
- The Beauty of Fractal Geometry (#SoME2)
- This SHAPE will change the WORLD !
Others:
- How fractals can help you understand the universe | BBC Ideas
- The complex geometry of Islamic design - Eric Broug
- Turning Math Into Art With Beautiful Fractals
42 Docs:
Github Library:
- https://github.com/42Paris/minilibx-linux
- https://github.com/codam-coding-college/MLX42
Gitbook
Resources:
- https://qst0.github.io/ft_libgfx/man_mlx.html ⭐️
- https://gontjarow.github.io/MiniLibX/mlx-tutorial-create-image.html ⭐️
- Pixel drawing with the minilibx
Video:
github explination: https://github.com/suspectedoceano/mlx/tree/main/mlx_explained
video resources:
Resources :
- https://fractalfoundation.org/OFC/OFC-5-5.html
- fract-ol: creating graphically beautiful fractals
- https://medium.com/@jalal92/fractol-22a21a1ad5bd
video: