Burning Ship

The Burning Ship fractal, first described and created by Michael Michelitsch and Otto E. Rössler in 1992, is generated by iterating the function in the complex plane C which will either escape or remain bounded. The difference between this calculation and that for the Mandelbrot set is that the real and imaginary components are set to their respective absolute values before squaring at each iteration. The mapping is nonanalytic because its real and imaginary parts do not obey the Cauchy–Riemann equations.
The basic function, in C++ using OpenGL, to generate this set is:
void renderBurningShip(void)
{
int x, y, cnt, maxIter;
complex z, t, t2;
maxIter = 256.0;
imaginaryXMandelbrot = (maxXMandelbrot  minXMandelbrot) / (GLdouble)currScreenWidth;
imaginaryYMandelbrot = (maxYMandelbrot  minYMaldenbrot) / (GLdouble)currScreenHeight;
for (x = 0, z.x = minXMandelbrot; x < currScreenWidth; x++, z.x += imaginaryXMandelbrot)
{ // z = x + i*y;
for (y = 0, z.y = minYMaldenbrot; y < currScreenHeight; y++, z.y += imaginaryYMandelbrot)
{
t2 = z;
cnt = 0;
while ((t2.x * t2.x + t2.y * t2.y <= 4) && (cnt < maxIter))
{
t.x = t2.x*t2.x  t2.y*t2.y  z.x;
t2.y = 2 * fabs(t2.x*t2.y)  z.y;
t2.x = t.x;
cnt++;
}
}
}
}
{
int x, y, cnt, maxIter;
complex z, t, t2;
maxIter = 256.0;
imaginaryXMandelbrot = (maxXMandelbrot  minXMandelbrot) / (GLdouble)currScreenWidth;
imaginaryYMandelbrot = (maxYMandelbrot  minYMaldenbrot) / (GLdouble)currScreenHeight;
for (x = 0, z.x = minXMandelbrot; x < currScreenWidth; x++, z.x += imaginaryXMandelbrot)
{ // z = x + i*y;
for (y = 0, z.y = minYMaldenbrot; y < currScreenHeight; y++, z.y += imaginaryYMandelbrot)
{
t2 = z;
cnt = 0;
while ((t2.x * t2.x + t2.y * t2.y <= 4) && (cnt < maxIter))
{
t.x = t2.x*t2.x  t2.y*t2.y  z.x;
t2.y = 2 * fabs(t2.x*t2.y)  z.y;
t2.x = t.x;
cnt++;
}
}
}
}
And we get the following result:
In my program you are able to move coordinate axis with arrow keys, also to zoom in and out with keys Q and A. Also to speed up or slow down zooming with the keys W and S, change colours simply by pressing C.
You can download source, working with Windows and MacOS X prior to 10.9, here: LINK