﻿ Penta Mandelbrot Set

### Pentabrot Set

It is the same Mandelbrot set, we just iterate function z^5 + c instead of z^2 + c.

The basic function, in C++ using OpenGL, to generate this set is:

void renderPentabrot(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.x*t2.x*t2.x) - 10 * t2.x*t2.x*t2.x*t2.y*t2.y + 5 * t2.x *t2.y*t2.y*t2.y*t2.y + z.x;
t2.y = 5 * t2.x*t2.x*t2.x*t2.x*t2.y - 10 * t2.x*t2.x*t2.y*t2.y*t2.y + t2.y*t2.y*t2.y*t2.y*t2.y + z.y;
t2.x = t.x;
cnt++;
}
}
}
}

This is what do we get: 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