Welcome to Fractal Forums

Fractal Math, Chaos Theory & Research => General Discussion => Topic started by: cKleinhuis on September 23, 2011, 07:03:13 PM




Title: how would you define a path along mandelbrot border ?
Post by: cKleinhuis on September 23, 2011, 07:03:13 PM
we all know that the most interesting shapes of the julia renderings are having seeds close, very close to the border of the mandelbrot set, when i was doing realtime julia animation i always wanted
to have a smooth path along the border, but couldnt find any method for it, to create a path, somehow the iteration borders would make good julia pathes, but how would you extract points from this, with the condition that the mandelbrot set is NOT crossed ?
 :hmh: :hmh:


Title: Re: how would you define a path along mandelbrot border ?
Post by: eiffie on September 23, 2011, 07:25:07 PM
All I can think of is "feeling" your way along. Start on the border and test nearby points in four directions. Bisect the angle between a point in and another out. Even this runs into the problem of creases/spirals where the only way out is back. Hopefully someone can think of a better approach.


Title: Re: how would you define a path along mandelbrot border ?
Post by: cKleinhuis on September 23, 2011, 07:37:05 PM
candidates would be all points on a certain iteration bailout band ...


Title: Re: how would you define a path along mandelbrot border ?
Post by: knighty on September 23, 2011, 08:11:52 PM
candidates would be all points on a certain iteration bailout band ...
or a certain distance :)
Some parts of the mandebrot set boudary (main cardioid, main disk...) that have analytical representation could also be used.


Title: Re: how would you define a path along mandelbrot border ?
Post by: fractower on September 23, 2011, 08:45:41 PM
A paint algorithm might work. Start with a point within the set an recursively mark neighboring points if they are within the set. Unfortunately this is likely create islands so some more work is needed to find a single bounding path.

You could probably paint the outside as well. It is guaranteed not to produce the same islands as the in set paint. Then combine the two to produce a single bounding path.



Title: Re: how would you define a path along mandelbrot border ?
Post by: fractower on September 24, 2011, 12:42:30 AM
I thought about this some more. The islands are only a problem if you want to automatically extract a particular path.

Once you have a 2D array that indicates points of capture and escape, the extraction can be done using a boundary walking state machine. The statemachine starts with the left foot in a capture square and its right foot in an escape square. It examines the two squares in front of it and decides to turn left, turn right or go forward. There are 4 possible inputs but only one is ambiguous. As long as the ambiguous case is handled consistently it will not get trapped in a small inlet/peninsula loop. 




Title: Re: how would you define a path along mandelbrot border ?
Post by: s31415 on September 24, 2011, 11:44:37 AM
Mmmhhh... if you want to compute an approximate boundary just to make an animation of Julia sets, you don't need to be very precise. A very small change in the position of the seed will translate in changes of small details of the Julia set, that are likely to be invisible in your animation. As a result, your path doesn't really need to follow the boundary accurately. So I would just pick enough points near the boundary and interpolate linearly between them.

But of course, determining the boundary is an interesting problem in itself. As was aready mentionned, the iteration number bands (or smoothed version thereof) provide better and better approximations to the boundary as the number of iterations increases. And I'm not sure what more you could hope. It seems unlikely that there would exist an explicit parameterization.


Title: Re: how would you define a path along mandelbrot border ?
Post by: eiffie on September 27, 2011, 05:09:41 PM
I just wanted to implement fractower's algorithm but wound up learning a bunch about how to determine the seed of a julia set. Particularly the number of arms to the spirals tell you the node(bump) and subnodes on the mandelbrot where the seed lies.
http://www.youtube.com/watch?v=abU1Mv9kmXU
I'm now ready to guess the seed value of any julia near the boarder of the mandelbrot! Maybe not an ability for superhero status :(


Title: Re: how would you define a path along mandelbrot border ?
Post by: s31415 on September 27, 2011, 05:26:44 PM
Great animation! I must say I'd love to see it computed at a higher iteration number, so that the many spirals get resolved. And maybe with the M-set in a corner, so that it doesn't interfere with the Julias.


Title: Re: how would you define a path along mandelbrot border ?
Post by: knighty on September 28, 2011, 12:27:12 AM
that julia looks alive :)


Title: Re: how would you define a path along mandelbrot border ?
Post by: David Makin on September 28, 2011, 12:57:17 AM
When asked to create a long animation (I mean at least 30 mins) for DVD I played around quite a while with morphing Julia Sets with exactly this question in mind - my conclusion was that unless you're desperately concerned with render times and so want to avoid areas of "inside" at all cost then allowing some frames of the animation to be Julias with inside showing actually enhances the video as it adds greater variety.

At the time my PC was *really* out of date and I couldn't possibly have rendered the full-res animations myself and even the guy wanting them couldn't render at anything like the rate we can nowadays so I ended up doing a number of short sequences that had several different start and end frames in common just at low res while creating them (320*240) and then I sent them to the guy and he played around with the order, linking the different sequences until he had a satisfactory result that lasted the required time - he then rendered the same small sequences at full res and then created the final video.

In case anyone's interested, I later played with the sequences a little myself to create a 5min animation for YouTube - please forgive the res (just 240p) and the music too - the choices YouTube had available then were fairly limited :

http://www.youtube.com/user/makinmagicfractals#p/u/61/YlbfYK5YC4o (http://www.youtube.com/user/makinmagicfractals#p/u/61/YlbfYK5YC4o)

The animation works best for me to almost anything by Pink Floyd, Tangerine Dream, JM Jarre or the Afro Celt Sound System ;)
In hindsight for this sort of thing I should have written some customised colouring formulas that would have allowed smooth morphing of the orbit trap colouring between different styles e.g. point to line to waves to pinch etc. as that would have improved things a lot !


Title: Re: how would you define a path along mandelbrot border ?
Post by: hobold on October 13, 2011, 02:48:02 PM
The idea of accurately tracing the boundary of the Mandelbrot set has been haunting me since more than 20 years. This thread prompted me to begin tinkering again. So I wrote a program that would be guaranteed to be impractical and useless, even if it happened to work reliably.

What it does is to locate the points where equipotential lines (AKA lemniscates, AKA level set borders) intersect field lines (AKA external rays, AKA binary decomposition borders). These points have the nice property that they are distributed densely in areas where the border is convoluted, but spaced sparsely in regions of low detail.

Nevertheless, the program is near useless, because the number of such points grows proportionally to 2 to the Nth power, where N is the number of iterations. So you cannot get very close to the border of the actual set before computation times and memory consumption explode. Furthermore, in highly detailed areas, adjacent border points move close to each other as the number of iterations increases. So you tend to run out of numerical precision rather sooner than later.

The good news is that you don't have to bother optimizing that kind of program much. A factor of two speedup only brings you one iteration closer to the actual border. :)

With double precision floating point, I could only get as far as 27 iterations. That takes a bit over an hour to compute, and a bit more than 6GB of RAM. Memory consumption could probably be reduced by a factor of 2 or 4, but what for? The resulting polylines are always huge and cannot really be optimized away.

Anyways, attached is an image of that final borderline number 27.

If anybody is still interested after my anti-advertisement, I could clean up the source code a bit, and let you experiment with it. It's a very basic command line program with no platform specific code.


Title: Re: how would you define a path along mandelbrot border ?
Post by: cKleinhuis on October 13, 2011, 04:59:10 PM
nice, the aproach seems to work, although it is a pitty how hard it is to calculate closer lines of that

cleaning out some pixels and getting a smooth julia transform path, with making sure that no "inside" is crossed would now be the next step :D

would love to see an animation of that julia path... :D


Title: Re: how would you define a path along mandelbrot border ?
Post by: hobold on October 13, 2011, 05:46:05 PM
Well, if smooth animation of morphing Julia sets is the primary purpose, you'd probably be better off with a path based on a distance estimator. You would be at a (more or less) constant distance from the Mandelbrot set, and the path would inherently be smoothed. I don't know how to compute something like that with any kind of consistent accuracy, though.

The level set curves (like the one I showed above) are not that good for Julia morphs, in my opinion. They spend a lot of time near antennas and spikes, but cannot closely approach areas like the "neck" between main cardioid and largest disk. A path at constant distance would still avoid the "neck", but would not focus as much on the spikes.

(The level set curves were relatively easy to compute because the vertices along one level make excellent starting points for the search of next level's vertices. That way, I can be confident in the accuracy of the algorithm, even though I do not have any analytical guarantees to rely on. It's a dumb, straight forward method that keeps adapting, refining, and correcting itself as it goes.)

You sure you don't want to play with the source code yourself, no matter the limitations? :)


Title: Re: how would you define a path along mandelbrot border ?
Post by: eiffie on October 13, 2011, 05:50:35 PM
code please! :)


Title: Re: how would you define a path along mandelbrot border ?
Post by: fractower on October 13, 2011, 07:15:35 PM
Quote
intersect field lines (AKA external rays, AKA binary decomposition borders)

Hi Hobold,
How did you chose where to seed the rays? Do you have a way to calculate the distance between points on the iso-contour boundary?


Title: Re: how would you define a path along mandelbrot border ?
Post by: hobold on October 13, 2011, 07:23:36 PM
I feared you would never ask! :)

My apologies to everybody who can appreciate all my subtle programming sins. I hope the pain is bearable. This is not polished, production quality code.


Title: Re: how would you define a path along mandelbrot border ?
Post by: hobold on October 13, 2011, 07:37:23 PM
How did you chose where to seed the rays? Do you have a way to calculate the distance between points on the iso-contour boundary?
If you look at the picture I attached earlier, you can see the Mandelbrot set surrounded by a warped checker board pattern. The algorithm scans along the edges of those curvy rectangles and locks on to their corners.

I start from one of the outer (almost-)circles, with a few hand initialized vertices. Then I can refine an existing polyline from there repeatedly. First I move the vertices inward by scanning along the respective bin border. Then one new point is inserted halfway between any two existing points, and its location refined with bisection. I can make use of the theoretical property that equipotential lines are always orthogonal to field lines to get good initial guesses of scanning direction.

It's not a particularly sophisticated method. But todays hardware has so much brute force ...

EDIT: Wait! You want to know where that checker board pattern is coming from? The equipotential lines are just the usual coloring according to number of iterations. The rays emerge when you look at the sign bit of the imaginary component of the final iteration. I.e. you check if the escaped value is above or below the real axis, and then brighten or darken the pixel accordingly.


Title: Re: how would you define a path along mandelbrot border ?
Post by: eiffie on October 14, 2011, 05:39:08 PM
Thanks for the code. I translated the program to C# just to make it even more useless. It works well as a game of chicken between my RAM and ADHD.


Title: Re: how would you define a path along mandelbrot border ?
Post by: hobold on October 14, 2011, 06:03:57 PM
If I get enough complaints about the program's uselessness, I might even go and shoehorn my homebrew multiprecision arithmetic into it. Then it can waste even more cycles and RAM. :)

But jokes aside, If anyone wants to play with the algorithm, trying to make it more practically useful, I'll gladly explain whatever the hell I was thinking when I wrote some unintelligible piece of the program. Ask away! There are no stupid questions, only stupid answers.


Title: Re: how would you define a path along mandelbrot border ?
Post by: fractower on October 15, 2011, 09:49:17 AM
Quote
EDIT: Wait! You want to know where that checker board pattern is coming from?

Actually that was my question. I have seen that pattern before but did not know the algorithm.

The adaptive walker code was very interesting. If you are not careful it might turn out to be useful at some point.


Title: Re: how would you define a path along mandelbrot border ?
Post by: hobold on October 15, 2011, 07:28:53 PM
The adaptive walker code was very interesting. If you are not careful it might turn out to be useful at some point.
Glad you liked it!

As always, my ideas and code fragments come with a "give credit where credit is due" license, and otherwise I do not care if you get rich or famous with them. I would love to be rewarded with ever more beautiful fractal imagery, and I would hate if you took over the world with a logic bomb that I helped build. But there is no obligation to do the former or to not do the latter. :)


Title: Re: how would you define a path along mandelbrot border ?
Post by: eiffie on October 18, 2011, 04:48:40 PM
Now what am I going to do with this logic bomb?  :sad1:


Title: Re: how would you define a path along mandelbrot border ?
Post by: cKleinhuis on October 18, 2011, 09:09:01 PM
a julia animation :D


Title: Re: how would you define a path along mandelbrot border ?
Post by: asimes on February 28, 2012, 09:30:41 AM
I almost have it... I think. Here was my method:

- Find all points that are part of the Mandelbrot Set
- Find all points that touch the Mandelbrot Set that are not inside of it (I'll call this Boundary Set)
- Organize the Boundary Set by theta and store the associated real and imaginary points in that order
- Run the Julia Set in a loop through the organized points

It doesn't quite work as well as I would like. It is pretty close but it looks glitchy because organization by theta is not quite accurate enough. Here's the result so far: http://alexsimes.com/Julia_Test/index.html

Also, I noticed that this topic is pretty old, I'm going to repost this in a new topic.