A Glimpse of the Elusive 3D Mandelbrot or Iterating in All Dimensions

January 15th, 2024 by Diana Coman

Since earlier first pictures of the 3d complex space were quite encouraging, I took the time to figure out all these additional dimensions a bit better1 and to implement directly the generic, N-dimensional case. After all, why stop at 3 dimensions only, when the complex space clearly has in fact many more dimensions than it ever apparently got much credit for? And it packs a lot into these additional dimensions, too, so take what follows as only a first glimpse and nothing more - an appetizer, if you wish, not even by far the full course, feel free to go exploring and make your own discoveries as well.

To start with, my generalization from the classical Mandelbrot to N-dimensions is quite straightforward: while the classical formula is iterating z^2+c where z is a 2D complex number2 and c a constant 2D complex number, I'll iterate z^2 + c where z is a N-d complex number3 and c is a constant N-D complex number. Setting as usual a maximum number of iterations and a bailout value means that one can obtain as a result the Mandelbrot set in 2D if the usual 2D complex numbers are used, in 3D if 3D complex numbers are used or in any N dimensions if N-d complex numbers are used. To illustrate this, here's the section of such a Mandelbrot set, as obtained when fixing the 'camera' on the same coordinates4, with exactly the same colouring5 and simply calculated in turn in the 2D complex space and then 3D, 4D, 6D and 8D complex space:






If that first picture for the 2D complex space took you a bit by surprise as it's quite a close up of the cardioid shape, here's the same with the average curvature colouring that highlights better the well-known mandelbrot shapes in the mini-mandelbrots emerging on the border to the right:


And to remove any doubts, hopefully, let's change the colouring method outside the set to highlight the normals via a very simple shading model that brings out into the open what's going on exactly on that border in 2D, 3D, 4D, 5D or indeed any D:



The more dramatic 'half-half' colouring in this picture is just a matter of lighting - in all the others the light is simply set to avoid this sort of sharp border at 0. Here's the very same result with the more uniform light to match all the others in this set:


As for the first observations on the series above, I think that the Mandelbrot shape is quite clearly emerging in all cases, with each dimension only literally adding its detail on yet another direction as it were. There's also quite clearly a better view in this limited 2D slicing of the results when the underlying complex space has at least an even number of dimensions. Even in the odd cases though, there isn't a direct breakage6, only the clear 'cut' of bands, which seems to me more of an indication of a trouble with the perspective/visual capacity essentially than a structural issue. Whether slicing through an odd or an even dimensional space, the 2d image even while looking supposedly at the "same slice", it still captures quite strikingly different results. Which makes it all in turn perhaps quite interesting to consider that this is literally an illustration of how the 'unseen' dimensions have nevertheless quite a direct and visible impact on the 'seen' ones, isn't it?

Setting aside for now any further musings on unseen dimensions, there are certainly other ways of picking a slice of the resulting N-dimensional object to look at. And the structural properties of the 3D complex space suggest at least one option that has perhaps some more usefulness in being more closely matched to the space that I'm trying to explore visually first of all: the cone xy-xz+yz=0 is quite special in that it's only when at least one point from this cone is involved that some 'usual' properties hold (most notably |z1*z2| being the same as |z1|*|z2| or in other words, the size of the product being the same as the product of the two sizes).

For the next set of images, instead of mapping the flat image space to an equally flat square or rectangle looked at from a fixed z distance, I map it to the above cone - the x and y are mapped as before7 but the z is then calculated so that the resulting point is on the xy-xz+yz=0 cone. The result is... butterflies with mandelbrot patterns on their wings. Some more obviously butterflies or more obviously mandelbrot patterned depending mostly on the colouring scheme chosen rather than anything else and I'll let the reader figure out (or merely guess, even) the underlying number of dimensions in each case:


Finally, for further evidence that what one sees is quite dependent on how one knows (or chooses!) to interpret what one looks at, here are a few images obtained from some of the exact same sets as calculated above, only coloured without discarding the 0 values of unperformed iterations once the bailout value was already reached:


  1. There's a more structured discussion that I found quite useful on the 3D complex numbers and their geometric and algebraic properties in the paper "On a Novel 3D Hypercomplex Number System" by Jacobi, Shlomo and Shmoish, Michael, 2015

  2. x+y*i with x,y real values and i^2=-1 

  3. a0+a1*i+a2*i^2+a3*i^3+...+a(N-1)*i^(N-1) with a0, a1... a(N-1) real numbers and i^N=-1 

  4. For the record, the section in question covers x from -1.5 to 1.5, y from -1.5 to 1.5. The image space is linearly mapped on to this 2d space. Where the complex space has more than 2 dimensions, the z is then fixed as 'distance to camera', at 0.375 and the corresponding transformation to x and y is applied to yield the actual components of the complex number that is then iterated. In all cases, the components beyond these 3 start as 0. 

  5. The average stripes method which is both quite useful to show a lot of information about what's going on *outside* the set itself and otherwise fitting really well with my trig-based colouring palette since it's literally relying on the very same parametrisation of the cos function under the hood. 

  6. Not even of the 'noisy areas' type that broke at times the fern's tip in the first attempt - it turns out that most of that is likely an artefact of my too cautious earlier implementation when I hadn't quite fully grasped the unexpected fact that the 3D complex space has divisors of 0 that are however non-zero themselves and thus quite entirely safe to divide by. 

  7. To be precise, in some images the y covers from -1.0 to 1.0 hence the 'diagonal' ending up not quite matching the image's own principal diagonal. 

Comments feed: RSS 2.0

One Response to “A Glimpse of the Elusive 3D Mandelbrot or Iterating in All Dimensions”

  1. Diana Coman says:

    As there was an offline observation regarding the shading model being potentially a bit too much to follow above, note that despite its name, it's the sort I tend to pick at every turn - doing the job at hand without being more complicated than it has to be for it. Hence it's quite easy to explain, too, since it's literally as little as calculating the dot product between the normal to the surface at some point and the light vector considered, using the result then to decide on the colour.

    The Lambert lighting model or cosine law states that the amount of light received at a point on a surface is directly proportional to the angle between the incoming ray of light and the normal to the surface at that point, so I calculate the cos of that angle via the dot product and then feed that into the same colouring scheme as the rest to obtain the final colour, that's all.

Leave a Reply