Title: How to color by periodicity? Post by: Khashishi on June 30, 2017, 10:08:19 PM Is there an algorithm to color by periodicity, other than brute force checking each iteration vs all previous iterates?
Title: Re: How to color by periodicity? Post by: claude on June 30, 2017, 11:38:09 PM Here's a method for the quadratic Mandelbrot set, could probably be adapted to arbitrary integer power:
https://mathr.co.uk/blog/2014-11-02_practical_interior_distance_rendering.html Title: Re: How to color by periodicity? Post by: Khashishi on July 03, 2017, 10:17:54 PM Cool. I've implemented it and it works. I found I can speed it up by putting a bailout check in attractor(...), i.e.
if (|z| > 4) return 0; Thanks. It was easy to generalize to positive integer powers. I tried fractional powers, but it looks a bit glitchy. I tried a negative power, but it doesn't look right, so I probably have to examine the math a little more closely. Title: Re: How to color by periodicity? Post by: Khashishi on July 17, 2017, 07:56:30 PM Negative powers, I just brute force it.
I store the value of z for each iteration. After max iterations, I check z against each previous iteration, starting from the second to last and going in reverse. Match indicates a period. Easy and works. Title: Re: How to color by periodicity? Post by: greentexas on July 20, 2017, 06:09:03 PM I do NOT think this will necessarily help you, but I have an idea:
You can detect the period by iterating a point. If the point gets within a small distance from z0 (say 0.1 units), we can say that the number of iterations used is the period. For example, when iterating [-0.7 + 0.3i], z11 gets within 0.06 units of z0. This point isn't in the M-set, but if it was, we could give a color to this point for having period 11, and give all other points of the same period the same color. We could do this to all possible periods, and obtain an M-set with colored bulbs! Title: Re: How to color by periodicity? Post by: claude on July 22, 2017, 03:35:14 PM If the point gets within a small distance from z0 (say 0.1 units), we can say that the number of iterations used is the period. Unfortunately that doesn't work very well, because the periodic limit cycle usually doesn't contain z0, so you need a lot of manual fiddling with thresholds etc. The admittedly much more complicated method I describe gives good results at any zoom level, and can even be adapted for perturbation techniques. Title: Re: How to color by periodicity? Post by: xenodreambuie on July 23, 2017, 12:11:21 AM Greentexas's idea is close. If you first iterate up to max iterations, if the point hasn't escaped to the high bailout you can use the final point as z0, then iterate it until it returns to within "low bailout" of there to find the period. I think this is overall the fastest method, and avoids storing points. It also generalizes to any formula without modification, except for formulas with only finite critical points. In this case you can first iterate from one critical point until max iterations, store that point as z1, then iterate from a second critical point until it either hits z1 or max iterations. Then store the point as z0 and iterate for the period as above. |