Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- f21 = Compile[{{n, _Real}, {x, _Real}, {y, _Real}}, Re[
- With[{f =
- Nest[If[Abs[#] <= 100, (#^2 + x + I y), #] &, 0, Floor[n]],
- t = n - Floor[n]},
- f (1 - t) + (f^2 + x + I y) (t)
- ]
- ], CompilationTarget -> "C"];
- f22 = Compile[{{n, _Real}, {x, _Real}, {y, _Real}},
- Im[
- With[{f =
- Nest[If[Abs[#] <= 100, (#^2 + x + I y), #] &, 0, Floor[n]],
- t = n - Floor[n]},
- f (1 - t) + (f^2 + x + I y) (t)
- ]
- ]
- , CompilationTarget -> "C"];
- img0 = Rasterize[Graphics[
- Table[
- {ColorData["DarkRainbow"][r], Disk[{0, 0}, 1 - r]}
- , {r, 0, 1, 0.04}]
- , Background -> Black], RasterSize -> 200, ImageSize -> 200];
- frame[n_] := ImageTransformation[img0,
- Function[{p}, With[{x = p[[1]], y = p[[2]]},
- {f21[n, x, y], f22[n, x, y]}
- ]
- ]
- , DataRange -> {{-2, 1}, {-1.5, 1.5}}];
- frames = Table[frame[n^2], {n, 1, 3.5, 2.5/87}];
- Export["mandel.gif", frames]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement