Skip to content

wsfhahn/mandelbrot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mandelbrot

What does this project do?

This project creates an animated GIF of the Mandelbrot set with increasing precision in each frame.

What is the Mandelbrot set?

For the quadratic map zₙ₊₁ = zₙ² + c, where z is a complex number and c is a complex number as a constant, there exists a set of values of c such that the value of z remains bounded as the map is applied.

The set of values c that keep z bounded is known as the Mandelbrot set. When the Mandelbrot set is plotted on the complex plane (real component of c on the X axis and imaginary on the Y axis), a beautiful fractal pattern appears.

How do I use it?

This project is built with uv. If you don't have UV, install it using the following command:

curl -LsSf https://astral.sh/uv/install.sh | sh

To create a virtual environment and install the necessary packages, run:

uv sync

Inside main.py, there are a few variables to set:

  1. MAX_PRECISION: Precision of the plot in the last frame of the GIF
  2. X_MIN Minimum X value (minimum value of the real component)
  3. X_MAX Maximum X value (maximum value of the real component)
  4. Y_MIN: Minimum Y value (minimum value of the complex component)
  5. Y_MAX: Maximum Y value (maximum valeu of the complex component)
  6. STEP_SIZE: Controls the resolution of the plot
  7. IMAGE_PATH: Path to save the animated plot to.

Once these variables are set, it's ready to rip. Run the main loop with the following command:

uv run main.py

Is this entirely human written?

Yes, this project is entirely human-written. It is a zero-AI weekend project.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages