As a kid, I always enjoyed looking at pictures of fractals on the internet. The ordered chaos that lies within these infinitely rough coastlines still captivates my interest. My interest led me to make my own generator in Golang, which can draw fractals formed from iterating functions in the complex plane.
Tetration Fractal
Binet's Formula Fractal
Gamma Function Fractal
The program can also plot strange attractors - formed from the evolution of differential equations:
A Clifford Attractor
A Svennson Attractor
A modified Polynomial Attractor
This program was also a small foray into concurrent programming. At first, each image pixel was computed in sequence, one at a time. Naturally, this makes it difficult to generate high-quality images at 8k by 8k pixel resolution, which was my goal.
This 256 by 256 pixel 'crab', found deep within the Tetration Fractal, was used to benchmark different implementations of the program.
When computing each pixel in order, the crab takes 1.5s to generate.
Assigning a group of 8 threads one pixel each takes 489ms to generate.
Assigning a group of 8 threads one row each takes 265ms to generate.
By using concurrency, the program now completes 82% faster! This lets me generate 8k by 8k images in only ~35 minutes, as opposed to multiple hours. Future speed upgrades will come in stopping calculations early, such as when iterations converge to a value.