Hi all! This is a program designed to generate the mandelbrot set.
https://en.wikipedia.org/wiki/Mandelbrot_set
The mandelbrot set is a cool fractal. Okay, that doesn't narrow it down much.
The mandelbrot set is a fractal generated by taking the function zc(x)=x2+c, where c is a complex number and x starts at 0, and applying it forever and ever. Is it infinite? Not in the set :(. Is it finite? In the set :).
But wait! I don't have the time or patience to run it forever! Now what?
Aha! There's a trick! See, if the absolute value of zc ever goes above 2, then it will end up going to infinity, and will not be in the set! So, I just go through all the points, preform zc(x) however many times, and check if the absolute value is greater than 2!
That's the implementation, now for the actual instructions.
A few parameters are given pre-render to control the appearance:
The size of the display. (duh!) 800 or 1000 usually works best for me. I recommend using a multiple of four. (see below)
The number of points rendered per unit on default zoom. For example, if set to 25 (the default), it will render 25 points between 0 and 1, and 25*4=100 points on the x-axis. Works best when 4*ppu is a multiple of of the size, as each pixel is the same size.
The number of times zc is applied to x. When setting a high # of iterations, it's best to have a low points per unit so that it doesn't lag super hard, if you want to do any exploring..
How the mandelbrot set is colored. 0 sets it to no color (black), 1 colors by cycle (e.g. i becomes a cycle of length 2, -1+i -> -i -> -1+i).
Controls whether or not the screen is updated mid-render. Always treated as 0/False
for the first run.
Move - WASD
Zoom in/out- C/Z (respectively)
Refresh screen- R (NOTE: SCREEN WILL NOT RE-RENDER UNTIL THIS KEY IS PRESSED)
Home (set to default view)- H