Inspiration
I have been fascinated by imaginary numbers since I first learned of them in algebra, but they have always seemed too advanced for me. I finally decided to give it my best shot, and model the Mandelbrot set, a complex sequence
What it does
My program renders the Mandelbrot fractal at up to 1e-17 zoom levels (smaller than 1 pixel/atom) in real time, without GPU acceleration, and with no libraries other than Ray-lib for drawing to the screen.
How I built it
The program uses up to 8 threads to calculate sequence iterations in parallel. Rendering is done by passing an array of color values representing pixels to a basic renderer. To quickly find the limit as the sequence approaches infinity, I calculate the derivative of the sequence after each iteration to plot its growth rate.
Challenges I ran into
Floating point numbers are notoriously difficult to work with. Operations with them are slow and often very inaccurate. Zooming in many orders of magnitude requires both speed and precision. By leveraging my knowledge of algebra, the IEEE floating point implementation, and discreet calculus, I achieved real time rendering on my ancient laptop.
Accomplishments that I'm proud of
I managed to accomplish all of this without resorting to third party math libraries for complex number representations or calculations. All math is done using float primitives and a significant degree of ingenuity.
What we learned
I learned how to apply derivatives to basic complex functions. I also learned much more about Rust's fearless concurrency, and how to effectively parallelize a linear algorithm.
What's next for Diving into Imagination
From my research, I believe creating a feature complete, fully optimized Mandelbrot set model would require a degree in pure math, or at the least a much greater knowledge of math concepts than I have. However, this does not mean there is no room for improvement. The user interface could be completely overhauled to aid understand-ability. It may also be possible to use asynchronous ahead of time processing and buffering to create smooth transitions between zoom states.


Log in or sign up for Devpost to join the conversation.