Skip to content

inesalves44/fract-ol

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fract-ol (42 lvl - 2)

Overview

This is a repository for the 42 school project of fract-ol. The point for this project is to create a program that renders different fractals.

What is a fractal?

According to Wikipedia a fractal is: "In mathematics, a fractal is a geometric shape containing detailed structure at arbitrarily small scales, usually having a fractal dimension strictly exceeding the topological dimension".

Basically a fractal is a geometric figure with a never ending pattern.

Mandatory Part

For the mandatory part, the objective was to use mlx library to create, in a window the Mandelbrot set and the Julia set.

To run the mandatory part in the project directory write: make all.

The project runs like this:

./fractol FRACTAL

For the mandatory part for both fractals here are the options:

  1. To change the window size run the program with iwNUMBER and ihNUMBER (in what order you want);
For example: ./fractol mandelbrot iw300 ih500
  1. The mousewheel zooms in and out in the center;
  2. ESC and the cross of the window closes the window.

Mandelbrot Set

Screenshot from 2023-02-14 19-55-05

Mathematical formula: f(z) = z² + C (iterating different values of C, which is a complex number)

Julia Set

Screenshot from 2023-02-14 19-57-07

Mathematical formula: f(z) = z² + C -> Here the C is constant.

For the Julia set you can also change the image by runing the program like this:

./fractol Julia cxNUMBER cyNUMBER -> the cx nuber should be between -2 and 1 and the cy should be between -1,5 and 1,5!

Bonus

To compile the bonus: make bonus.

For the Bonus you can run the program only by:

./fractol

Then this window will be displayed and you should input in the terminal one of the options (numbers or fractals).

Screenshot from 2023-02-14 20-12-07

After reading the input from the terminal we have this prompt:

Screenshot from 2023-02-15 19-58-06

This window shows you the rendering options!

Mandelbrot

mandelbrot

zoom

Julia

julia

zoom + changing inputs and colors!

Burning Ship

bs

The Burning Ship is a fractal that works with the module of mandelbrot!

Make Commands

make all - creates executable
make bonus - creates executable for bonus
make clean - clean the objects
make fclean - clean executable and any library, also runs clean
make re - runs clean and fclean and then runs all to create the executable
make rebonus - runs clean and fclean and then runs all to create the executable for bonus

Links

Mandelbrot example

Julia example

Minilibx

Thanks for reading!!

you can slack me: idias-al

About

fract-ol project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published