The only mappings that preserve shape in any number of dimensions are the Mobius mappings. Fractals that use these mappings include Kleinian fractals or 'Indra's pearls', Apollonian gaskets and other weird names. However these shapes are regular, artificial geometric patterns. Here I have built the mandelbrot set of randomly picked Mobius mappings, and painting each pixel with a temperature gradient of the number of non-escaping points. It gives some striking images:
Similar to the normal Mandelbrot set, which is defined as:
z = z2+c
These images are defined as:
v = m2(v)+c
Where m2(v) is a double-valued function, so it returns two vectors which are each a different Mobius transformation of v. A Mobius transformation is any combination of translation, scale, rotation and invert-flip. This equation means that the number of vectors doubles each iteration step, and we paint each pixel based on how many paths stay within a threshold. If the threshold is well chosen then we can terminate paths early when they escape it.
Quite strangely many of these images look 3d complete with lighting. No idea why that is-
If you keep the translation part of m2(v) at zero then the results seem to be always connected, like this:
The code to generate the count per-pixel is here:
recurse(int &count, Vector2 &point, Vector2 &C, int depth)
for (i = 0; i<2; i++)
// 1. this is a invert (which naturally flips the handedness)
Vector2 pos = point - bends[i];
pos *= bends[i].magnitudeSquared() / pos.magnitudeSquared();
pos += bends[i];
// 2. so a (second) flip is necessary (so not anti-conformal)
pos -= 2.0 * flips[i] * pos.dot(flips[i]) / flips[i].magnitudeSquared(); // 2 flips make a rotation
// 3. arbitrary translations
pos += shifts[i];
// 4. scale up
pos *= scale;
// 5. add the offset (the initial pixel position)
pos += C;
if (pos.magnitudeSquared() > threshold)
continue;
if (depth == 0)
count++;
else
recurse(count, pos, offset, depth - 1);
A simple example exists where shifts are (0,0) and (0,0), bends are (1,0) and (0,1), flips are (-1,1) and (1,-1), scale is 2, threshold is 4. Viewed from -1 to 1 with initial depth 16:
This example extends cleanly into 3d.
In fact, the 3D version, along with many 2D examples, are displayed and described in Chapter 5 of my book Exploring Scale Symmetry, published by World Scientific.