Logo by fractalwizz - Contribute your own Logo!

END OF AN ERA, FRACTALFORUMS.COM IS CONTINUED ON FRACTALFORUMS.ORG

it was a great time but no longer maintainable by c.Kleinhuis contact him for any data retrieval,
thanks and see you perhaps in 10 years again

this forum will stay online for reference
News: Visit us on facebook
 
*
Welcome, Guest. Please login or register. July 19, 2018, 07:41:33 PM


Login with username, password and session length


The All New FractalForums is now in Public Beta Testing! Visit FractalForums.org and check it out!


Pages: [1]   Go Down
  Print  
Share this topic on DiggShare this topic on FacebookShare this topic on GoogleShare this topic on RedditShare this topic on StumbleUponShare this topic on Twitter
Author Topic: How to color by periodicity?  (Read 602 times)
0 Members and 1 Guest are viewing this topic.
Khashishi
Forums Freshman
**
Posts: 13


« 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?
Logged
claude
Fractal Bachius
*
Posts: 563



WWW
« Reply #1 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
Logged
Khashishi
Forums Freshman
**
Posts: 13


« Reply #2 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.
« Last Edit: July 03, 2017, 10:41:13 PM by Khashishi » Logged
Khashishi
Forums Freshman
**
Posts: 13


« Reply #3 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.
Logged
greentexas
Navigator
*****
Posts: 64


« Reply #4 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!
Logged
claude
Fractal Bachius
*
Posts: 563



WWW
« Reply #5 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.
Logged
xenodreambuie
Conqueror
*******
Posts: 124



WWW
« Reply #6 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.
Logged

Regards, Garth
http://xenodream.com
Pages: [1]   Go Down
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
Determining color Programming « 1 2 » kronikel 15 2194 Last post January 21, 2011, 08:00:20 PM
by Duncan C
Color bands Mandelbulb 3d bib 6 921 Last post March 10, 2011, 10:23:13 PM
by marius
It's all about color Mandelbulb 3d chaos_crystal 4 1000 Last post March 07, 2011, 07:32:54 PM
by Madman
color problem Mandelbulb 3d scheven_architect 1 698 Last post April 30, 2011, 12:06:04 AM
by Sockratease
Color Box Gestaltlupe Gallery trafassel 0 384 Last post October 02, 2011, 08:32:30 PM
by trafassel

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM
Page created in 0.155 seconds with 27 queries. (Pretty URLs adds 0.011s, 2q)