Author Archive for Philippe Guglielmetti

16
Aug
04

Plasma Fractal

Plasma Fractal – adapted from Justin Seyster’s Plasma Java applet. This code generates non-periodic random textures using a bisection method. This is another popular technique for generating terrain.
(* runtime: 19 seconds *)
n = 256; image = Table[0, {n}, {n}];
Plasma[w_, {x_, y_}, {{a_, c_}, {g_, i_}}] := If[w < 2, image[[y + 1, x + 1]] = (a + c + g + i)/4, Module[{b = (a + c)/2, d = (a + g)/2, e = Min[Max[(a + c + g + i)/4 + 1.5 (Random[] - 0.5) w/n, 0], 1], f = (c + i)/2, h = (g + i)/2}, Plasma[w/2, {x, y}, {{d, e}, {g, h}}]; Plasma[w/2, {x + w/2, y}, {{e, f}, {h, i}}]; Plasma[w/2, {x, y + w/2}, {{a, b}, {d, e}}]; Plasma[w/2, {x + w/2, y + w/2}, {{b, c}, {e, f}}]]]; Plasma[n, {0, 0}, Table[Random[], {2}, {2}]];
ListDensityPlot[image, Mesh -> False, Frame -> False, ColorFunction -> Hue];

Advertisements
11
Jun
04

Barnsley’s Tree Julia Set Fractal

Barnsley’s Tree Julia Set Fractal – as seen on MathWorld :
zn+1 = zc(zn – sign(Re(zn))), zc = 0.6+1.1i
(* runtime: 38 seconds *)
Julia = Compile[{{z, _Complex}}, Length[FixedPointList[f, z, 100, SameTest -> (Abs[#] > 2 &)]]];
f[z_] := c(z - Sign[Re[z]]);
c = 0.6 + 1.1 I;
DensityPlot[Julia[x + I y], {x, -2, 2}, {y, -2, 2}, PlotPoints -> 275, Mesh -> False, Frame -> False, ColorFunction -> Hue];




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

  • 550,399 hits