A tool for exploring Latin-square 4D hypercomplex fractals.
The Mandelbrot set was so beautiful that everyone wanted a 3D version of it. The first idea was to extend complex numbers into higher dimensions, which gives you the 4D quaternions - but the quaternion Mandelbrot looks very boring. So people tried different routes for years, such as extending complex numbers with rotations that led to the Mandelbulb, or custom power functions made by hand.
Looking at quaternions and those custom functions, you can see that the
A 4×4 Latin square on
(In the tool, there’s a table listing all 24 groups with a tiny preview image. The groups that produce good fractals have a colored preview - the rest are grayed out.)
The main canvas shows a 3D slice of the 4D fractal.
Below that we have the controls:
- ID input that encodes the table index (0-575), the signs for all 16 cells of the table (2 bytes, each bit 0=+, 1=-), and the slice plane.
- id = table_number + sign_flags × 576 + slice × 576*(2^16)
- Slices - 0 (w=0), 1 (z=0), 2 (y=0), 3 (x=0).
- A 4×4 grid of sign buttons.
- An input for table number (0 to 575)
Raymarching is used to render the fractals. For that we need a distance estimation function.
For quaternions, the norm is multiplicative (
But this is not valid for any other 4D algebra. The multiplication table breaks the norm property, so we have to use the full Jacobian (tracking
To fix it, I used:
where
The Jacobian can also be used for normals:
