|Hazelnut - 2021-02-18 |
I've been reading about how they compute these very deep zooms into Mandelbrot sets, because lockdown does things to a man.
This video zooms by 48 powers of ten -- for comparison to zoom from the known universe to a single electron would be about 38 powers of ten. You'll find recent videos in the last few years that go past 2000 powers. I prefer this video because of its groovier location, and I think a universe-to-electron zoom in six minutes is plenty.
Now a Mandelbrot set is a simple mathematical object: it's just the complex numbers "c" for which you can iterate "z = z^2 + c" (starting with z = 0) forever without z leaving a circle of radius 2. You can write computer code to plot this in like 20 lines tops of your favourite language, more like 5 if they handle complex math well.
Therefore in theory you can zoom in forever. For most simple geographical objects that is trivial. Imagine a radius-1 circle centered at the origin. I can easily "zoom in" a zillion powers of ten at point (0, 1) and tell you exactly what it look like: a horizontal line. The corner of a mathematical triangle looks the same at 1000x as at 10x.
In practice, as you zoom deeper and deeper to the _edge_ of a Mandelbrot set you run into computational limits. First, the numbers have more precision. Zoom in a little, and the "c" represented by a particular pixel might be "0.103 + 0.35i". But as you zoom deeper, now it's "0.10322709 + 0.34943912i". More digits means more work for the computer just as it would be more work for us, for the same basic reasons (only internally a computer's doing it all in binary). By the end of this clip a given value of "c" has 50ish base-ten digits, which is 165ish binary digits, which is awkward on consumer hardware so the software works around it (doing multiple underlying hardware multiplications and carrying).
A bigger problem is the number of iterations. Remember the definition at point "c" is whether we can iterate "z = z^2 + c" forever. "Forever" takes forever to calculate so you usually just pick a max # of iterations to test. All the way zoomed out, 100 iterations per pixel is plenty. But as you zoom way in, you're looking at "c" values aaaaalmost but not quite in the set, and these require a huge number of iterations -- at 2000 powers of ten you need something like 30,000,000 iterations per pixel. There's a lot of pixels in an image and a lot of images in a video -- at that point an intractable work even for a computer.
So here's where it gets weirder. What fast open source plotters like Kalles Fraktaler 2 do is they CHEAT a little, using "perturbation techniques and series approximations" to skip a lot of the math and get what should look to the human eye like the same thing (but can "glitch" as with any approximation heuristic). Fuck if I know how it works though -- the elevator pitch makes sense but when I try to follow the actual math and... no. Can't do it.
I pray lockdown ends before I understand that code.