https://github.com/starlitdreams/mandelbrot-set-plotter
This repository contains a simple Mandelbrot set plotter in C++ using SDL2. It visualizes the Mandelbrot set by calculating iterations for each point in the complex plane. Features include customizable colors and efficient SDL2 rendering. Requires SDL2 and a C++ compiler. Contributions welcome. Licensed under MIT.
https://github.com/starlitdreams/mandelbrot-set-plotter
cmath complex-numbers cpp math numeric sdl2
Last synced: about 1 month ago
JSON representation
This repository contains a simple Mandelbrot set plotter in C++ using SDL2. It visualizes the Mandelbrot set by calculating iterations for each point in the complex plane. Features include customizable colors and efficient SDL2 rendering. Requires SDL2 and a C++ compiler. Contributions welcome. Licensed under MIT.
- Host: GitHub
- URL: https://github.com/starlitdreams/mandelbrot-set-plotter
- Owner: StarlitDreams
- License: mit
- Created: 2024-06-14T08:27:48.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-14T13:02:24.000Z (about 2 years ago)
- Last Synced: 2025-03-04T12:19:24.974Z (over 1 year ago)
- Topics: cmath, complex-numbers, cpp, math, numeric, sdl2
- Language: C++
- Homepage:
- Size: 12.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Mandelbrot Set Plotter
This project is a simple Mandelbrot set plotter written in C++ using SDL2. The Mandelbrot set is a famous fractal defined by iterating a complex function. This program generates a visual representation of the Mandelbrot set by calculating the number of iterations it takes for each point in the complex plane to escape a given radius.
## Features
- Computes and visualizes the Mandelbrot set.
- Uses SDL2 for rendering.
- Custom linear interpolation function for coordinate mapping.
- Adjustable color scheme based on the iteration count.
## Example

## Prerequisites
- SDL2 library
- C++ compiler (e.g., g++)
## Building and Running the Program
### Windows
1. Ensure you have the SDL2 library installed. You can download it from [SDL2 Downloads](https://www.libsdl.org/download-2.0.php) or using MSYS
```sh
pacman -S mingw-w64-x86_64-SDL2
3. Clone this repository or download the source code.
4. Open a terminal or command prompt and navigate to the directory containing the source code.
5. Compile the code using the following command:
```sh
g++ -fdiagnostics-color=always -g path_to_your_source_code/mandelbrot.cpp -o path_to_your_output_directory/mandelbrot.exe -Ipath_to_sdl2_include -Lpath_to_sdl2_lib -lmingw32 -lSDL2main -lSDL2 -mconsole
## License
This project is licensed under the MIT License. See the LICENSE file for details.