A variation on the Mandelbrot set, the folded Mandelbrot.
Try out this Mandelbrot Viewer. My gratitude goes to the original authors of the viewer and libraries.
function countIterations(x, y) {
var count = 0;
var t = x;
x=-y;
y=t;
var zx = x;
var zy = y;
var n = 100;
var p = 200;
while (count < maxIterations && zx*zx + zy*zy < 20) {
if (0==(count+1)%n) {
x += zx*count/p;
y += zy*count/p;
n--;
p++;
}
var new_zx = zx*zx - zy*zy + x;
zy = 2*zx*zy + y;
zx = new_zx;
count++;
}
var angle = Math.floor((Math.atan(zy/zx)+Math.PI/2)/Math.PI*count);
return count < maxIterations ? count : angle;
}