I nearly forgot to post before bed T_T
I made this for a school project, but now that it is graded and fully optimized, I want to post it here ^..^
This uses a quite inefficient method for rendering the Mandelbrot set, in Python Turtle. It almost works like a printer. It took me eight days from when I started to complete the very first version, and then took me until yesterday to fully optimize it (It used to take an hour and a half to finish running T^T). It took my teacher's old iPad 4 minutes to render it in its current state!
Please enjoy .^ ^.
EDIT: Wow, this is on the hot tab. Everyone, thanks. ^ ^"
This is a cool program, could you explain how it works? I'm familiar with the equation f(z) = z^2 + c or something like that, but I'm not sure I quite understand what's happening in this program.
@MatthewDoan1 Sure thing!
Since you already know the equation, I assume you know about complex numbers and the complex plane.
The program sets the turtle to the top left of what is, in terms of the complex plane, a 2 by 4 section around (0, 0i). Then, it moves the turtle horizontally to the other side of the plane, and does that over and over again, moving it down a row every time.
For every point, it iterates the equation until it finds that the iteration number's corresponding index in the MAG list is less than the absolute value of z. Once it finds that, it breaks out of the loop. This saves a massive amount of time, as before it was finding the optimal color, but still kept checking for a better one. Also, since the majority of the points it will check will be identified quickly (since they escape to infinity much faster), this cuts even more time off of the total render time.
If you have any further questions, please do let me know; I'd be delighted to help out.
Please pardon any bad grammar.. Σ( > _ < ; )
@AmazingMech2418 I do, in fact, know how it works!
Think of it this way: Each and every point on the complex plane has an individual, unique Julia Set, right? Well, those Julia Sets are like a bunch of mirrors: Reflections, of reflections, of reflections, etcetera etcetera.
(Sorry, I am not good with words _ _ This is difficult to explain)
Although before I go on, I must ask, what do you mean by "works?" Do you mean, why does it have such complicated patterns despite only changing the initial value by such minuscule amounts? Or, do you mean, why does it form any pattern at all?
@AmazingMech2418 Ah, I see.
Unfortunately, that is pretty much one of the only things I do not fully understand about the Mandelbrot Set. Although, now that you've mentioned it, I am pretty sure it has something to do with Complex Exponentation (or something equivalent).
Really sorry, but I do not know the exact answer to this..
@LizFoster It's fine. I have an equation that I derived for complex exponentiation that I could possibly send you so that you can maybe figure out from that. I just have to find it first... I just don't really know how an equation can create a fractal anyways and was wondering about this specific equation for the Mandelbrot Set.
@LizFoster Well, I just realized that I never actually found a formula for every exponent, but
x^(a+bi)=x^a(cos(b*ln(x))+i*sin(b*ln(x))). I also have a formula for any logarithm if that may help, but it is VERY long.
wow, this is very amazing and satisfying! To be honest, I could watch this all day on repeat.