This one has been a long time coming. The first applet I ever made for the site was a Julia set explorer, and although it would take me months to learn how to optimize it to a reasonable speed, even the first version was a large step forward in the kind of fractal generation code I’d written up to that point. Although it wasn’t what I’d intended the applet to do, it was fun to mess with the code behind the scenes and make Julia sets from different generating functions. I thought about making applets out of some of them, but it was never worth copying all the code over just for a slight variation on a theme. What I needed was an applet that allowed for near-complete control over its own code — and so here we are at last.
The large text box contains the function the applet iterates to create its Mandelbrot and Julia sets. It’s written with an actual complex number library, which means the performance is markedly worse than the original Julia set explorer applet, but it’s a great trade. The other three boxes are for parameters that modify the output — how much of the set can be seen, how bright everything is, and how far away from zero a number has to get before the applet decides it’s never going to come back down.
This is far from the most user-friendly applet, but hopefully you can get something out of it. Here are some functions to get started — see if you can find some interesting ones yourself!
\(z^2 + c:\) z.pow(2).add(c)
\(z^4 + c:\) z.pow(4).add(c)
\(\sin(z + c):\) z.add(c).sin()