Skip to content

A 2D simulation of the recursive steps during the calculation of a selected complex set.

License

Notifications You must be signed in to change notification settings

RobLaughlin/complex-set-simulator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Set Simulator

This simulation uses Numpy to generate a 2D array of pixels mapped to points on the complex plane. These complex points are converted to RGB values where the color of each pixel states how far that complex number is in the recursive process of the selected set.

Docs

https://roblaughlin.github.io/complex-set-simulator/

Mandelbrot Set Recursive Definition

The Mandelbrot Set is defined as the set of all complex numbers that converge as the number of recursions (n) approach infinity.

Mandelbrot Set Recursive Definition

It has been proven that if the absolute value of some complex number C is greater than 2 at any point in the recursive process, that complex number is divergent and not in the set. We use that very convenient fact in the program.

Visual Example

Mandelbrot Set Example Simulation

Notice how the color changes as we zoom into the set. Every black pixel is a complex number that is in the set, while every other pixel is colored somewhere farther on the color spectrum based on how many iterations it took before that complex number (pixel) began to diverge.

Complex numbers colored orange took longer to diverge than complex numbers colored red, yellow longer than orange, green longer than yellow, etc, until the end of the spectrum (maximum recursions). This depends entirely on the color map selected in the GUI. The set simulator has since been updated to handle many different colormaps included by matplotlib.

Usage

To run the simulation,

python app.py

To build a single file executable,

python build.py

Left-click to zoom in and right-click to zoom out. The more delay (MS) set within the GUI, the more lag introduced between each frame of animation. Lowering the delay nets a more smooth animation with higher tendency to lockup the GUI, so set the delay according to system specifications. Higher delay is recommended with higher resolution simulations. Have fun!

License

GNU GPLv3

About

A 2D simulation of the recursive steps during the calculation of a selected complex set.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages