This project explores the fascinating world of fractals, demonstrating how simple mathematical rules can generate intricate and beautiful patterns. Built using Python and Pygame, this repository features three visually stunning fractal visualizations. These fractals showcase the power of recursion, mathematical beauty, and computational efficiency.
📌 Overview This project showcases the following fractals:
- Sierpiński Gasket – A self-replicating triangular fractal generated using the Chaos Game.
- Julia Set – A complex-plane fractal created by iterating over complex numbers.
- Mandelbrot Set – A famous fractal that reveals infinite complexity through iterative calculations.
🛠 Technologies Used
- Python (for mathematical computations and graphics rendering)
- Pygame (for visualizing the fractals in an interactive environment)
- NumPy (for optimized calculations)
📂 Mathematical Background & Algorithms Fractals are generated based on mathematical formulas and iterative processes:
- Sierpiński Gasket uses midpoint displacement in a triangle.
-
Julia Set follows the recursive formula:
$$z_{n+1} = z_n^2 + c$$
where c is a complex constant. - Mandelbrot Set iterates the same equation, but with c representing each pixel's complex coordinate.
Ensure Python 3.13, Pygame, and NumPy are installed:
pip install pygame numpy
Execute each fractal visualization with:
python Sierpinski_Pygame.py
python JuliaSet_Pygame.py
python Mandelbrot_Pygame.py
A triangle-based fractal generated by selecting midpoints iteratively.
Controls:
- Press any key to pause/resume.
- Click (X) to exit.
A stunning fractal generated from complex number transformations.
A world-famous fractal revealing infinite self-similarity.
Want to experiment with fractals? Try modifying:
- Iteration depth (for finer details)
- Color schemes (for visual appeal)
- Complex constants (in Julia Set for different patterns)
This project is licensed under the MIT License – feel free to use, modify, and share! If you use or modify this project, kindly credit the original repository.
📢 Author Note: This project is part of my portfolio, demonstrating my skills in Python and fractal visualizations.
🚀 Explore the beauty of fractals!