This project explores the fascinating world of fractals, demonstrating how simple mathematical rules can generate intricate and beautiful patterns. Built using C++ and graphics.h, this repository features multiple fractal visualizations, including Julia Sets, Mandelbrot Sets, and Sierpiński Gasket.
📌 Overview This project showcases the following fractals:
- Sierpiński Gasket – A self-replicating triangular fractal generated using a midpoint algorithm.
- 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
- C++ (for mathematical computations and graphics rendering)
- graphics.h (for visualizing the fractals)
- conio.h (for console-based interactions)
- cmath (for mathematical 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 you have a C++ compiler and graphics.h installed:
- Install a compiler like MinGW (for Windows) or g++ (for Linux/macOS).
- Install the necessary graphics library for your system.
g++ fractal.cpp -o fractal -lgraphics -lbgi -lgdi32 -lcomdlg32 -luuid -loleaut32 -lole32
fractal.exe
g++ fractal.cpp -o fractal -lSDL2
./fractal
A triangle-based fractal generated by selecting midpoints iteratively.
A stunning fractal generated from complex number transformations.
🎨 Example Output:
-Julia Set, with
-Julia Set, with
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 C++ and fractal visualizations.
🚀 Explore the beauty of fractals!