based on Daniel White’s formula for squaring a 3D hypercomplex number

## Archive for the 'Hypercomplex' Category

### 3D Julia Set

### 4D “Roundy” Julia Set

{x,y,z,w}^{2} = {x^{2}-y^{2}-z^{2}-w^{2}, 2(xy+zw), 2(xz+yw), 2(xw+yz)}

c={-0.2,0.8,0,0}, imax=12

### 4D “Roundy” Mandelbrot Set

{x,y,z,w}^{2} = {x^{2}-y^{2}-z^{2}-w^{2}, 2(xy+zw), 2(xz+yw), 2(xw+yz)}

This formula for squaring a 4D hypercomplex number is probably the most popular method for creating 3D Mandelbrot sets. Here is some Mathematica code:

`(* runtime: 1.2 minutes, increase n for higher resolution *)`

n = 100; Norm[x_] := x.x; Square[{x_, y_, z_, w_}] := {x^2 - y^2 - z^2 - w^2, 2 (x y + z w), 2 (x z + y w), 2 (x w + y z)};

Mandelbrot4D[qc_] := Module[{q = {0, 0, 0, 0}, i = 0}, While[i < 24 && Norm[q] < 4, q = Square[q] + qc; i++]; i];

image = Table[z = 1.5; While[z >= 0 && Mandelbrot4D[{x, y, z, 0}] < 24, z -= 3/n]; If[z < 0, -1.5, z], {y, -1.5, 1.5, 3/n}, {x, -2.0, 1.0, 3/n}];

ListDensityPlot[image, Mesh -> False, Frame -> False, PlotRange -> {-0.1,1.5}]

### Links

- Genuine Mandelbrot 3D, Minibrot 3D, New Mandelbrot 3D, True 3D Julia, Patch with Julia Fractals – volumetric renderings, by Krzysztof Marczak, be sure to see his animation
- Space Station – volumetric mini-minibrot, by Krzysztof Marczak
- 3D Mandlebrot – by Thomas Ludwig
- 4D Mandy, Minibrot – by David Makin

### 4D Quaternion Mandelbrot Set

{x,y,z,w}^{2} = {x^{2}-y^{2}-z^{2}-w^{2}, 2xy, 2xz, 2xw}

Quaternions are 4D hypercomplex numbers, discovered in 1843 by Sir William Rowan Hamilton. They are mathematically elegant, but unfortunately, they produce axisymmetric results when used to calculate the 3D Mandelbrot set.

Link: Quat Minibrot – by David Makin

### 4D Mandelbrot Set

based on 4D analog to Daniel White’s formula for squaring a 3D hypercomplex number

Here is a 4D version of Daniel White’s formula for squaring a 3D hypercomplex number. In 4D, rotation is about a plane and there are 6 possible rotational matrices to choose from: Rxy, Ryz, Rxz, Rxw, Ryw, Rzw. Following this train of thought, I came up with the following 4D analog to Daniel’s formula by applying three consecutive 4D rotations:

{x,y,z,w}^{2} = Rxy(2θ)Rxz(2φ)Rxw(2ψ){r^{2},0,0,0}, r_{2}=sqrt(x^{2}+y^{2}), r_{3}=sqrt(x^{2}+y^{2}+z^{2}), r=sqrt(x^{2}+y^{2}+z^{2}+w^{2}), θ=atan(y/x), φ=atan(z/r_{2}), ψ=atan(w/r_{3})

This can be expanded to give:

{x, y, z, w}^{2} = r^{2}{cos(2ψ)cos(2φ)cos(2θ), cos(2ψ)cos(2φ)sin(2 θ), -cos(2ψ)sin(2φ), sin(2ψ)}

This formula reduces to Daniel’s squaring formula when w = 0 and reduces to the regular complex squaring formula when w = z = 0. For faster calculations, this formula can be simplified to:

{x, y, z, w}^{2} = {(x^{2}-y^{2})b, 2xyb, -2r_{2}za, 2r_{3}w}, a=1-w^{2}/r_{3}^{2}, b=a(1-z^{2}/r_{2}^{2})

Using this formula, I rendered 3D slices of this 4D Mandelbrot fractal at w = 0, z = 0, y = 0, x = 0. Note that the case when z = 0 happens to be the same as Karl’s variation of Daniel White’s formula.

### 3D Exponential Mandelbrot Set

This is what the Mandelbrot set looks like if you vary the exponent along the third dimension. It has a twisted shape because the features of the Mandelbrot set rotate as the exponent is increased. Technically, this is not a hypercomplex fractal, but it’s still worth mentioning here.

Here is some Mathematica code:

`(* runtime: 49 seconds, increase n for higher resolution *)`

n = 100; Mandelbrot[n_, zc_] := Module[{z = 0, i = 0}, While[i <12 && Abs[z] < 2, z = z^n + zc; i++]; i];

image = Table[y = 1.5; While[y >= 0 && Mandelbrot[z, x + I y] < 12, y -= 3/n]; y, {z, 1, 4, 3/n}, {x, -2, 1, 3/n}];

ListDensityPlot[image, Mesh -> False, Frame -> False, PlotRange -> {0, 1.5}]

### 4D Julibrot Set

The complex Julia set is typically calculated in 2D with a constant complex seed value. However, if you consider the set of all possible Julia sets (all possible seed values), you get the complete 4D Julibrot set. The Mandelbrot set is contained as a 2D slice of the 4D Julibrot set. You can also take 3D slices of the 4D Julibrot set as shown here. The left picture shows what the Mandelbrot set looks like if you vary the real part of the starting value along the third dimension and the right picture shows what it looks like when you vary the imaginary part. Technically, this is not a hypercomplex fractal, but it’s still worth mentioning here.

Here is some Mathematica code:

`(* runtime: 18 seconds, increase n for higher resolution *)`

n = 100; Julibrot[z0_, zc_] := Module[{z = z0, i = 0}, While[i <12 && Abs[z] < 2, z = z^2 + zc; i++]; i];

image = Table[z = 1.5; While[z >= 0 && Julibrot[z, x + I y] < 12, z -= 3/n]; z, {y, -1.5, 1.5, 3/n}, {x, -2, 1, 3/n}];

ListDensityPlot[image, Mesh -> False, Frame -> False,PlotRange -> {0, 1.5}]

### Links

- Julia Set in Four Dimensions – good explanation, by Eric Baird
- Juliabrot Discussion – on Fractal Forums
- cross-section showing Mandelbrot set – by Ramiro Perez
- Alien Interface – animated Julibrot with orbit trapping, by David Makin

## Recent Comments