Welcome to Fractal Forums

Fractal Math, Chaos Theory & Research => Theory => Topic started by: Paolo Bonzini on December 08, 2009, 01:29:39 AM




Title: The REAL math of the Mandelbulb
Post by: Paolo Bonzini on December 08, 2009, 01:29:39 AM
[LONG POST]

Finally I got it.  The "triplex numbers" are really quaternions in disguise, and the "z = z^N+c" is really "v = |v|^N (q(v)^N i q(v)^-N) + c", where v is a 3D vector and q(v) is a function from a 3D vector v to a quaternion.  For example, in the reversed-sign definition (the one giving (x,y,z)^0=(1,0,0), in the "old" ;-) terminology) you have these:

1) rotation by theta along z is expressed by cos(theta/2) + k sin(theta/2)

2) rotation by -phi along y is expressed by cos(phi/2) - j sin(phi/2)

and multiplying them gives

q(v)     = cos(theta(v)/2) cos(phi(v)/2) + i sin(phi(v)/2) sin(theta(v)/2) - j cos(theta(v)/2) sin(phi(v)/2) + k sin(theta(v)/2) cos(phi(v)/2)
q(v)^-1 = cos(theta(v)/2) cos(phi(v)/2) - i sin(phi(v)/2) sin(theta(v)/2) + j cos(theta(v)/2) sin(phi(v)/2) - k sin(theta(v)/2) cos(phi(v)/2)

where theta(v) and phi(v) are the usual functions arctan(y/x) and arcsin(z/|v|) for conversion to spherical coordinates.

As a sanity check, let's see what happens on the xy plane.  Remember that, at every iteration, a different rotation is applied!!!  However since the elevation is 0 for the initial vector, they will all have phi(v)=0 and q(v) takes the form

q(v) = cos(arctan(y/x)/2) + k sin(arctan(y/x)/2)

then

v = i x + j y
q(v) i q(v)^-1 = i cos(theta) + j sin(theta)
|v|^2 q(v) i q(v)^-1 = |v|^2 (i cos(theta) + j sin(theta))

which is of course complex squaring, just changed to use i/j instead of real/imaginary.

This may well mean that this is not "the real 3D mandelbrot"; after all, why should one definition of q be better than the others?  Or it may mean that they are all "real 3D mandelbrots" of course.  It depends on how optimist you are. :)  So, the ultimate quest is to study the space of q(v)...

That's way beyond my knowledge of math, but there is a lot of other work to do; I am halfway through the math for the cartesian<->polar conversion, for example.  Can you compute q(v) in cartesian coordinates?  It is not the same (see the other thread) to compute q(v)^N using repeated multiplication of quaternions and to use repeated multiplication of triplex numbers.  (The latter doesn't work).  Why?

Triplex numbers still have their place in various ways, and they are worth further investigation.  First because they are faster than quaternions :-) (or are they?...).  Second because the quaternion notation for mandelbulbs does not extend to 4D or more, so a deeper understanding of the "triplex number" representation is fundamental to extend the mandelbulb beyond 3D.

Possible steps, beyonds those I have already outlined, include:

1) to try and understand what triplex multiplication actually means (if anything) and what it means that triplex numbers commute; maybe there is a better, noncommutative but associative definition of multiplication?

2) to convert my definition of triplex exponential in terms of quaternion exponentials and see what happens;

3) to try and understand what it means that powers of triplex numbers use a (-pi, pi) range for the elevation (see the other thread).  How does this relate to cartesian formulas for triplex exponentiation?  What is different between computing v^n and v*v*v on a triplex number?

So far, everything seems to make sense...  It's kind of funny that the Mandelbulb started from "let's go away from quaternions", and ends up again dealing with quaternions!...


Title: Re: The REAL math of the Mandelbulb
Post by: zee on December 08, 2009, 02:41:01 AM
It seems you tried a lot of things before you found this :D

I think this brings not much knowledge but makes everything more complicated.

Maybe I didn't understand it because I don't speak english very well and I didn't understand why that should be like you wrote down.
But I'll trust you that your equations are correct and work.

My problem:

We have (2d) complex numbers - we get a mandelbrot by using z -> z^2+c with fixed point in (0,0)
We have (3d) triplex numbers - we get a mandelbulb by using z -> z^2+c with fixed point in (0,0,0)

Okay - We can describe both with a transformation with trignometric equations. (2d or 3d transformation)

But the complex numbers do this transformation only by the definition that i^2 = -1 (That creates the Mandelbrot). And thats the most amazing thing.

So what's about the triplex?

You didn't explained triplex by a 3d hypercomplex number but by quarternions AND a vector AND using the trigometric equations instead of squaring a linear combination of complex basis like in the definition of hypercomplex numbers.

I think the best thing in this is that you got a equation for z^n but its more complicated than the normal trigometric definition.


Title: Re: The REAL math of the Mandelbulb
Post by: Paolo Bonzini on December 08, 2009, 02:59:00 AM
No, I didn't really try many things.  I just started from quaternions=rotations and saw where it led me...

I know this is more complicated than the triplex, but there is a reason why mathematicians could never get 3D complex numbers to work... they're all much smarter than I am.  So I want to use well-tested concepts.  As I said, the triplex is important, but if you want to understand _why_ it works, you have to reason in terms of well-known mathematical objects.  Otherwise you risk ending up trying to square the circle.  I felt this way several times in the last few days, this definition is much less "risky".

Also, my definition includes all variations of the Mandelbulb, while in the other thread we were focusing on one particular version.  Wouldn't it be nicer to understand what is common to all of them, i.e. what happens when you rotate (that's q(v)^N i q(v)^{-N}) and stretch (that's |v|^N) by amounts that depend on where you are in 3D space.


Title: Re: The REAL math of the Mandelbulb
Post by: Paolo Bonzini on December 09, 2009, 09:46:54 PM
Would you change your mind on quaternions if I told you that the 2D mandelbrot can be written as v=vi\bar v+c? :-)

In the formulation of the top post it is v=qi\bar q+c with q(v)=vi.  I find that quite aesthetically appealing. :-)


Title: Re: The REAL math of the Mandelbulb
Post by: twinbee on December 10, 2009, 03:59:25 PM
I'm not enough of a mathematician to fully appreciate what you've done, but hey, it could be promising - well done!

One question; are as many properties in the 3D hypercomplex realm lost as much as say, octonions are? Higher dimensional number systems suffer from greater 'losses' such as noncommutativity, and I was wondering how dimension 3 fared on this scale.


Title: Re: The REAL math of the Mandelbulb
Post by: Paolo Bonzini on December 10, 2009, 04:21:41 PM
I'm not enough of a mathematician to fully appreciate what you've done, but hey, it could be promising - well done!
Thanks for the kind words.

One question; are as many properties in the 3D hypercomplex realm lost as much as say, octonions are? Higher dimensional number systems suffer from greater 'losses' such as noncommutativity, and I was wondering how dimension 3 fared on this scale.
Uhm, as badly as possible.  Worse than any 2^N-ions.  Octonions lose associativity, sedenions lose alternativity, but all of them keep power associativity; Paul's 3D things are not power associative.

I'm writing down the things above in a paper, the WIP link is http://github.com/bonzini/mbulb/raw/master/mbulb.pdf

The gist of it (which I haven't written yet) is: there may be no 3D Mandelbrot (just an infinite family of them), but what you did makes a lot of sense and can be handled in a mathematically rigorous way.  Let me know if you find the WIP paper unreadable or just bad; or feel free to send me nice pictures to include. :-)


Title: Re: The REAL math of the Mandelbulb
Post by: David Makin on December 10, 2009, 05:33:53 PM
I'm not enough of a mathematician to fully appreciate what you've done, but hey, it could be promising - well done!
Thanks for the kind words.

One question; are as many properties in the 3D hypercomplex realm lost as much as say, octonions are? Higher dimensional number systems suffer from greater 'losses' such as noncommutativity, and I was wondering how dimension 3 fared on this scale.
Uhm, as badly as possible.  Worse than any 2^N-ions.  Octonions lose associativity, sedenions lose alternativity, but all of them keep power associativity; Paul's 3D things are not power associative.

I'm writing down the things above in a paper, the WIP link is http://github.com/bonzini/mbulb/raw/master/mbulb.pdf

The gist of it (which I haven't written yet) is: there may be no 3D Mandelbrot (just an infinite family of them), but what you did makes a lot of sense and can be handled in a mathematically rigorous way.  Let me know if you find the WIP paper unreadable or just bad; or feel free to send me nice pictures to include. :-)

At least they *are* comutative ;)


Title: Re: The REAL math of the Mandelbulb
Post by: Paolo Bonzini on December 12, 2009, 02:55:28 AM
At least they *are* comutative ;)

But the cartesian formulas for them are bogus ;)

I finished my paper, feel free to post criticism and corrections, or to suggest points where it's not clear.  I'll probably add an appendix with expanded formulas or algorithms, but the important stuff is there or it can be looked up on Wikipedia.

Regarding speed, it looks like it is mostly the same as Paul's formulas for N=2 (counting operations).  However, with quaternions doubling N costs only additional 7 multiplications and 3 additions because of associativity, while Paul's formulas quickly get more complicated and harder to optimize.


Title: Re: The REAL math of the Mandelbulb
Post by: JosLeys on December 12, 2009, 10:27:58 AM
Quote
I finished my paper, feel free to post criticism and corrections

Where do we find the finished paper?


Title: Re: The REAL math of the Mandelbulb
Post by: Paolo Bonzini on December 12, 2009, 11:51:58 AM
Quote
I finished my paper, feel free to post criticism and corrections

Where do we find the finished paper?

At the usual place, but only after I am reminded to push it there. :-)