[GiF] Mandelzoom one-liner

Hey Wolfram Community. I’m always continually enthused by how concise mathematica code can be. I was looking over my collection of 1-liners and found this old gem. I would like to see any other language do this is as many characters:

mz_loop.gif

Here’s the code:

w = {-{3, 1}, {1, 1}};
Dynamic[w = ScalingTransform[.96 {1, 1}, {-1.56, 0}]@w;
 ImageAdjust@MandelbrotSetPlot[Complex @@@ w, Frame -> None]]

Challenge: can you tweak the parameters to make it loop around?

And here’s code to export the above gif:

w = {-{3, 1}, {1, 1}};
AbsoluteTiming[
 f = Table[Do[w = ScalingTransform[.98 {1, 1}, {-1.56, 0}]@w;, 4];
    MandelbrotSetPlot[Complex @@@ w, Frame -> None, PlotRangePadding -> 0,
      ImageResolution -> 1000, MaxIterations -> 100, EscapeRadius -> 10000, 
     ColorFunction -> ColorData["SunsetColors"], PerformanceGoal -> "Quality"], {300}];]
Export["mz.gif", f, "DisplayDurations" -> Table[.05, Length@f], ImageResolution -> 500]
11 Likes

Very nice, thanks for sharing!

Challenge: can you tweak the parameters to make it loop around?

I did not know it is possible to loop the Mandelbrot Set zoom. I thought there are very similar zoomed regions but not quite the same as original-zoom set.

2 Likes

Hi @Kapio Letto, Thanks for the shout out! Indeed, it’s a rather cool fact that it contains exactly self-similar pieces:

mz_repeat.gif

It would repeat itself infinitely with the right zoom point, but in the above example it manages only twice (before the numerical issues break the pattern).

6 Likes

2015-11-02_10-07-11.png

  • Congratulations! This post is now a Staff Pick as distinguished by a badge on your profile! Thank you, keep it coming!

Nice one-liner! I can just sit here and stare at it for hours!