Giter VIP home page Giter VIP logo

dpetrosy / 42-fractol Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 5.15 MB

42 School Fractol project: Fractal generator using MLX library.

License: MIT License

Makefile 2.27% C 74.56% Objective-C 12.79% Roff 9.33% Perl 0.29% Shell 0.76%
42 42-fractol 42cursus 42projects 42school 42yerevan burning-ship c complex-numbers fract-ol fractal-rendering fractals fractol fractol-42 julia-set mandelbox mandelbrot mathematics minilibx 42fractol

42-fractol's Introduction

Logo

Fractol Project

42 Yerevan Fractol
For further information about 42cursus and its projects, please refer to 42cursus repo.


📜 About Project

One of the first graphical projects at 42 School, fract-ol generates beautiful fractals from the complex numbers of
an iterative mathematical construct. A fractal is a fragmented geometrical figure that infinitely repeats itself at
smaller scales. This project uses the school's graphical library, MiniLibX.

For detailed information, refer to the subject of this project.

🚀 TLDR: The fract-ol project is one of the three "beginner" graphical projects of the 
	 cursus. It teaches you about using graphic library, advanced math, and more.

Note

Because of 42 School norm requirements:

  • Each function can't have more than 25 lines of code.
  • All variables are declared and aligned at the top of each function.
  • Project should be created just with allowed functions otherwise it's cheating.

📑 Fractals List

The program supports these fractal sets:

Name Formula
Mandelbrot $z_{n+1} = z_n^2 + c, z_0 = 0$
Julia $z_{n+1} = z_n^2 + c, z_0 = c$
Burning Ship $z_{n+1} = abs(z_n^2) + c, z_0 = 0$
Tricorn $z_{n+1} = \frac{}{z_n}^2 + c, z_0 = 0$
Mandelbox It's more complex, see this article
Celtic Mandelbar $z_{n+1} = \frac{}{z_n}^2 + c, z_0 = c$

🎮 Controls

The program supports the following controls:

Key Description
ESC Close the program window
Keys [1-6] Move to another fractal
Keys [Q-Y] Change the color of fractal
Keys [A-H] Change the color of fractal
Mouse Scroll Zoom in and out of the fractal
⬆️ ⬇️ ⬅️ ➡️ Change the viewpoint
Key L Lock Julia's fractal
Zero Reset the fractal to its initial state

👨‍💻 Usage

Requirements

The program is written in C language and thus needs the gcc compiler and some standard C libraries to run.

Instructions

1. Compiling the program

To compile the program, run:

$ cd path/to/fractol && make

2. How to run the program

Run the executable too see the help message:

./fractol

Or run with some supported fractal:

./fractol mandelbrot

🌄 Screenshots

Mandelbrot set

Fractal mono-colored Mandelbrot Fractal red blue and green striped Mandelbrot Fractal sun crest purple Mandelbrot

Julia set

Fractal purple green and yellow Julia Fractal red swirl Julia Fractal blue snowflake Julia

Burning Ship set

Fract-ol golden Burning Ship

Tricorn set

Fract-ol purple Tricorn

Mandelbox set

Fract-ol brown tribal Mandelbox

42-fractol's People

Contributors

dpetrosy avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.