24
Jul
09

4D “Roundy” Mandelbrot Set

Mandelbrot Set, imax=24

Minibrot, imax=21

{x,y,z,w}2 = {x2-y2-z2-w2, 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


0 Responses to “4D “Roundy” Mandelbrot Set”



  1. Leave a Comment

Leave a comment


Welcome !

You will find here some of my favorite hobbies and interests, especially science and art.

I hope you enjoy it!

Subscribe to the RSS feed to stay informed when I publish something new here.

I would love to hear from you! Please feel free to send me an email : bugman123-at-gmail-dot-com

Archives

Blog Stats

  • 578,809 hits