Blue colour:
{
vector pos = P;
vector pos = P;
vector z = P;
float dr = 1.0;
float r = 0.0;
for (int i = 0; i < Iterations ; i++) {
r = length(z);
if (r>Bailout) break;
float dr = 1.0;
float r = 0.0;
for (int i = 0; i < Iterations ; i++) {
r = length(z);
if (r>Bailout) break;
float theta = acos(z[2]/r);
float phi = atan2(z[1],z[0]);
dr = pow( r, Power-1.0)*Power*dr + 1.0;
float phi = atan2(z[1],z[0]);
dr = pow( r, Power-1.0)*Power*dr + 1.0;
float zr = pow( r,Power);
theta = theta*Power;
phi = phi*Power;
theta = theta*Power;
phi = phi*Power;
z = zr*vector(sin(theta)*cos(phi), sin(phi)*sin(theta), cos(theta));
z+=pos;
}
c.dist = 0.5*log(r)*r/dr;
}
z+=pos;
}
c.dist = 0.5*log(r)*r/dr;
}
Orange colour:
(x - a)² + (y - b)² + (z - c)² = r²
(x - a)² + (y - b)² + (z - c)² = r²