RosettaCodeData/Task/Mandelbrot-set/Mathematica/mandelbrot-set-2.math
2014-01-17 05:34:36 +00:00

7 lines
223 B
Text

cf = With[{
mandel = Block[{z = #, c = #},
Catch@Do[If[Abs[z] > 2, Throw@i]; z = z^2 + c, {i, 100}]] &
},
Compile[{},Table[mandel[y + x I], {x, -1, 1, 0.005}, {y, -2, 0.5, 0.005}]]
];
ArrayPlot[cf[]]