https://github.com/codebam/mandelbrot-set-generator
Mandelbrot generator using Python and Pygame
https://github.com/codebam/mandelbrot-set-generator
graphics mandelbrot pygame python
Last synced: 4 months ago
JSON representation
Mandelbrot generator using Python and Pygame
- Host: GitHub
- URL: https://github.com/codebam/mandelbrot-set-generator
- Owner: codebam
- License: cc0-1.0
- Created: 2016-05-30T17:07:14.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2023-01-27T03:42:34.000Z (over 2 years ago)
- Last Synced: 2025-01-15T13:58:19.340Z (6 months ago)
- Topics: graphics, mandelbrot, pygame, python
- Language: Python
- Homepage:
- Size: 140 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

# Mandelbrot Generator
Written in Python, Licensed under GPLv3
## Things I did to improve speed
- Most of the speed of the program is due to me using built in python complex mathematics which are more efficient.
- Since f(x) = -f(x) it prints both sides of the image at the same time, which makes it twice as fast [[proof](https://www.lucaswillems.com/en/articles/3/mandelbrot-set-symmetry)]
- A formula [here](https://en.wikipedia.org/wiki/Mandelbrot_set#Cardioid_.2F_bulb_checking) is used to prevent the iterations of the second period bulb.
- The display is only updated when necessary since this takes a lot of resources for each pixel. It is done line by line, because doing it all at once only improves speed by a few fractions of a second and isn't worth it.