Logo by wmauzey - 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: Support us via Flattr FLATTR Link
 
*
Welcome, Guest. Please login or register. March 28, 2024, 08:07:17 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: Help for an animation  (Read 1546 times)
0 Members and 1 Guest are viewing this topic.
Kali
Fractal Supremo
*****
Posts: 1138


« on: February 11, 2011, 02:54:51 PM »

I have this idea of animating self-similar parts of the mandelbrot set, to see better how they evolve as they change slightly when you dive deeper into the set, perhaps producing some interesting results.

But I need some help from some of the math geniuses here... how can I get "reference points" in a relative easy way, to know the coordinates of correspondence between each similar shape? (for example, each "seahorse" of the seahorse valley). Otherwise I have to do it "by hand", and the results will be limitated by my patience and free time (I don't have much of both  embarrass)
« Last Edit: February 11, 2011, 02:58:47 PM by Kali » Logged

David Makin
Global Moderator
Fractal Senior
******
Posts: 2286



Makin' Magic Fractals
WWW
« Reply #1 on: February 11, 2011, 09:40:39 PM »

If I understand you correctly then all I can think of that may help is the following:

Most (maybe all ??) fractal objects consist of individual points (or areas/volumes) that correspond to a given "genetic code".
With standard (convergent) IFS the code is reversed with respect to rendering using the escape-time method - with convergent IFS-style rendering the code for a given point is such that the *most* significant transform used is the *last* one but in the escape-time (divergent) method then the most significant transform is the *first* one.
Consider rendering a Sierpinski Triangle using the standard convergent IFS method, if we have a point "on" the fractal and apply to that point the transform corresponding to the top sub-triangle of the whole then the new point will be part of that top sub-triangle, if we then apply the transform for the bottom-left sub-triangle to the new point then the result will be within the bottom-left sub-triangle and so on.
However the case is a little different for using the escape-time method, here if we have a point that is "on" the fractal and in the top triangle of the 3 main sub-triangles then in a/any sequence that does not bail out for that point the first transform will be the one for that top sub-triangle and if the point is in the bottom-left sub-triangle of the top sub-triangle then the second code in the sequence will be for the transform corresponding to the bottom-left triangle and so on.

You may be wondering how the above helps answer your question, but please bear with me, I'll get there in the end...

With respect to a non-affine fractal things are slightly different, for instance you might think there's no "genetic code" to be associated with iterating z^2+c using the escape-time method but that's not correct, you just need to do a little extra work to get the code/s.
If you remember either the entire orbit (for a given pixel) or just the first n steps of the orbit then you can get either "iteration count" minus one or "n" minus one genetic codes - for z^2+c there are two possible codes per iteration, either the *backwards* orbit was +sqrt(z-c) OR -sqrt(z-c) and you can simply check your stored orbit values to see which was the case giving you a genetic sequence for that pixel position.

Further lets say we have a genetic code of 11100111001111 for a point on a z^2+c fractal then a point with code 00011100111001111 is self-similar to 14 iteration levels and 3 iteration levels deeper.

To be honest I'd realised the above a while ago but hadn't fully considered the possibilities it opens up until I wrote this reply.
Of course some non-affine formulas would be a hell of a lot more difficult to decode due to it being very difficult to decide which was the correct genetic code working backwards through the orbit.
Logged

The meaning and purpose of life is to give life purpose and meaning.

http://www.fractalgallery.co.uk/
"Makin' Magic Music" on Jango
Kali
Fractal Supremo
*****
Posts: 1138


« Reply #2 on: February 11, 2011, 10:25:55 PM »

Thank you very much David, I think I get the point.
But if i'm getting it right, I have to search & test a huge amount of points... but perhaps finding a small amount of self similar points by using this method, I can "decode" a simpler way to obtain more of them. For example, doing a calculation based on previous results, and looking for the "genetic code" inside a small area where the new similar point it's likely to occur.
I'll give it a try. Thanks again!
Logged

David Makin
Global Moderator
Fractal Senior
******
Posts: 2286



Makin' Magic Fractals
WWW
« Reply #3 on: February 12, 2011, 03:35:39 AM »

Of course I should have mentioned I was thinking of the problem from the point of view of an algorithmic solutiion i.e. to use a program to decode the genetics of the image and thus find corresponding points on self-similar areas e.g. store the codes for a given area of the fractal and maybe also provide this as a visual such that the user can then chose a point and the program will then highlight corresponding self-similar points at different iteration levels.
e.g. the user selects a point with code 1101100 and the program highlights all point with codes ending 1101100 (or just those ending in 01101100 or 11101100 or 001101100 or 011101100 or 101101100 or 111101100 etc.)
Logged

The meaning and purpose of life is to give life purpose and meaning.

http://www.fractalgallery.co.uk/
"Makin' Magic Music" on Jango
Kali
Fractal Supremo
*****
Posts: 1138


« Reply #4 on: February 12, 2011, 10:43:16 AM »

Yes, of course... When I wrote "I have to test and search for a huge amount of points", I mean MY PROGRAM has to do it. Otherwise you could be thinking of just me trying to do it by hand with a pen and a calculator   smiley
Honestly, It's hard for me to fully express my ideas in english  embarrass

What I'm trying to say is that the computation time will be long if I want to find the points deep into the set without looking also for another kind of "rule" that predicts where the point is likely to occur, based on previous results...

Logged

David Makin
Global Moderator
Fractal Senior
******
Posts: 2286



Makin' Magic Fractals
WWW
« Reply #5 on: February 12, 2011, 02:59:02 PM »

Well I haven't actually tested it in detail but for a 2D complex fractal then a given genetic code sequence (starting with that for the first iteration as the most significant) represents a given area e.g. for the z^2+c Mandelbrot then if all start points with positive imaginary component have genetic code 0 for the first iteration then all start points with negative imaginary component will have genetic code 1, similarly codes 00, 01, 10 and 11 (I think) will define 4 specific areas, a 3 bit code (3 iterations) == 8 areas etc.

The simplest case for the standard z^2+c Mandelbrot is of course the point (-2,0) for which the orbit immediately goes to the point attractor (2,0) on the first iteration - here the genetic code is 0111111111..... (or 100000000..... depending on how you code it) so any points with genetic codes of the form xx...xx011111111.... should be at the sharp end of minibrots (where the leading number of bitcodes gives the "depth" of the minibrot - from 1 bitcode to as many as you can get accurately).
Logged

The meaning and purpose of life is to give life purpose and meaning.

http://www.fractalgallery.co.uk/
"Makin' Magic Music" on Jango
Kali
Fractal Supremo
*****
Posts: 1138


« Reply #6 on: February 12, 2011, 03:26:33 PM »

I'll test your method later today and I'll keep you informed of the results... I think is a really clever solution to encode the points that way.
I appreciate your help. Thanks!
Logged

David Makin
Global Moderator
Fractal Senior
******
Posts: 2286



Makin' Magic Fractals
WWW
« Reply #7 on: February 12, 2011, 05:09:28 PM »

Here's a picture showing the genetics for 15 genetic codes (based on the first 16 iterations with maxiter 256 and bailout 1e20):



http://www.fractalforums.com/index.php?action=gallery;sa=view;id=5635
Logged

The meaning and purpose of life is to give life purpose and meaning.

http://www.fractalgallery.co.uk/
"Makin' Magic Music" on Jango
Kali
Fractal Supremo
*****
Posts: 1138


« Reply #8 on: February 13, 2011, 05:21:09 PM »

Nice, David!

I'm trying to do it on VB, but there's something I'm doing wrong...
I'm not using a complex number library, so I must calculate separated real and imaginary parts
I tried this inside the iteration part, but it doesn't work properly:

Code:

' Save old values:
zr2 = zr
zi2 = zi

' Calculate new values:
zr = zr * zr - zi * zi + x
zi = 2 * zr2 * zi + y

' Calculate z-c:
dr = zr - x
di = zi - y

' Calculate sqrt(z-c)
rr = Math.Sqrt((Math.Sqrt(dr * dr + di * di) + dr) / 2)
ri = Math.Sqrt((Math.Sqrt(dr * dr + di * di) - dr) / 2)*Math.Sign(ri)

' See if the results are equal than previous iteration value (otherwise the sign has changed), and then write the genetic code
If zr2 = rr and zi2 = ri Then
         gen(x, y) = gen(x, y) + "1"
Else
         gen(x, y) = gen(x, y) + "0"
End If


« Last Edit: February 13, 2011, 05:46:00 PM by Kali » Logged

Kali
Fractal Supremo
*****
Posts: 1138


« Reply #9 on: February 13, 2011, 06:04:27 PM »

There was a precision problem when I tested if the values from the previous iteration are exactly the same. I'm checking now only for the signs and I'm getting well definited areas and not diffuse patterns like before, but I'm not pretty sure they are right. I'll check the code a little bit more and then I'll upload some images of the results...
« Last Edit: February 13, 2011, 06:06:48 PM by Kali » Logged

David Makin
Global Moderator
Fractal Senior
******
Posts: 2286



Makin' Magic Fractals
WWW
« Reply #10 on: February 14, 2011, 01:03:09 AM »

There was a precision problem when I tested if the values from the previous iteration are exactly the same. I'm checking now only for the signs and I'm getting well definited areas and not diffuse patterns like before, but I'm not pretty sure they are right. I'll check the code a little bit more and then I'll upload some images of the results...


Ah - for the precision issue, in the image posted I actually used (here in pseudo-code):

if (magsquared(zold-ztest)>magsquared(zold+ztest))

Where ztest is sqrt(z-c) or sqrt(zold^2).
Which takes slightly longer obviously but completely eliminates any worries regarding precision error on an equality, even if the values of zold and ztest are very small indeed.

Of course the conditional ">" could be either way, it's not that essential since in this case it just reverses the binary code.

Also your code could be optimised:

Code:

' Save old values:
zr2 = zr
zi2 = zi

' Calculate z-c: (of course is actually just zold^2)
dr = zr*zr - zi*zi
di = 2*zr2*zi

' Calculate new values:
zr = dr + x
zi = di + y

' Calculate sqrt(z-c)
rr = Math.Sqrt((Math.Sqrt(dr * dr + di * di) + dr) / 2)
ri = Math.Sqrt((Math.Sqrt(dr * dr + di * di) - dr) / 2)*Math.Sign(ri)

' See if the results are equal than previous iteration value (otherwise the sign has changed), and then write the genetic code
If zr2 = rr and zi2 = ri Then
         gen(x, y) = gen(x, y) + "1"
Else
         gen(x, y) = gen(x, y) + "0"
End If

Logged

The meaning and purpose of life is to give life purpose and meaning.

http://www.fractalgallery.co.uk/
"Makin' Magic Music" on Jango
Kali
Fractal Supremo
*****
Posts: 1138


« Reply #11 on: February 14, 2011, 11:59:22 AM »

Thanks again, David.

As for the optimization, I don't know what I was thinking when I calculated +x +y and then back to -x -y to get the previous value 

embarrass


Logged

Kali
Fractal Supremo
*****
Posts: 1138


« Reply #12 on: February 19, 2011, 03:25:51 AM »

I put this project on stand-by... but if anyone has another good idea as David had, they are welcomed!
« Last Edit: February 19, 2011, 04:57:31 AM by Kali » Logged

Pages: [1]   Go Down
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
The Animation with Wildfire Movies Showcase (Rate My Movie) Nacer 0 770 Last post November 15, 2013, 01:55:18 PM
by Nacer
Animation , allow to load a previous animation (a jpg/png series) as background feature request PhotoComix 0 1362 Last post November 27, 2013, 01:30:11 PM
by PhotoComix
M3D Animation Mandelbulb3D Gallery artworkbygnbarnes 0 732 Last post June 02, 2014, 06:36:19 PM
by artworkbygnbarnes
Animation Help Mandelbulber Jonnyb42 1 728 Last post February 03, 2015, 11:21:00 PM
by taurus
Animation using Harmonograph equations Non-Fractal related Chit-Chat Haversine 4 15850 Last post February 16, 2015, 06:52:14 PM
by eiffie

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.192 seconds with 25 queries. (Pretty URLs adds 0.018s, 2q)