Welcome to Fractal Forums

Fractal Math, Chaos Theory & Research => Theory => Topic started by: TedWalther on November 26, 2009, 05:10:24 AM




Title: Has anyone tried this formula?
Post by: TedWalther on November 26, 2009, 05:10:24 AM
I will describe the algorithm in geometric terms.

The mandelbulb is based on doing the following:

basis vectors x = [1,0,0] y = [0,1,0] z = [0,0,1]
Take a 3d vector Z
rotate Z around z axis
rotate Z around x axis
double magnitude of Z
add a constant vector C

I believe it can be improved with this one small difference.  After the vector is rotated around the x axis, then also rotate the z axis by the same amount so that z, Z, and x are always in the same plane.

This way, a fresh new z axis is used in every iteration. The z axis will always be in the zy plane.

This produces the mandelbrot set for all Z,C pairs that are in the xy plane.  I believe this is the missing refinement to get a true 3d mandelbrot set.

Ted


Title: Has anyone tried this formula?
Post by: David Makin on November 26, 2009, 03:55:15 PM
I will describe the algorithm in geometric terms.

The mandelbulb is based on doing the following:

basis vectors x = [1,0,0] y = [0,1,0] z = [0,0,1]
Take a 3d vector Z
rotate Z around z axis
rotate Z around x axis
double magnitude of Z
add a constant vector C

I believe it can be improved with this one small difference.  After the vector is rotated around the x axis, then also rotate the z axis by the same amount so that z, Z, and x are always in the same plane.

This way, a fresh new z axis is used in every iteration. The z axis will always be in the zy plane.

This produces the mandelbrot set for all Z,C pairs that are in the xy plane.  I believe this is the missing refinement to get a true 3d mandelbrot set.

Ted

When you say "rotate Z around z axis" and "rotate Z around x axis", by which angles do you mean exactly ?
I assume for the first you mean atan2(x,y) (or should that be atan2(y,x) - it's a long time since I did it in C), but which angle do you mean for the rotation around the x axis ?
Also I suspect the result of what you suggest may just be the cut-down quaternionic version of the Mandy.

Also "This produces the Mandelbrot Set for all Z,C pairs that are in the xy plane.".....so does the Mandelbulb (sine version), it just doesn't do so for the xz plane.


Title: Has anyone tried this formula?
Post by: s31415 on November 26, 2009, 04:40:20 PM
I will describe the algorithm in geometric terms.

The mandelbulb is based on doing the following:

basis vectors x = [1,0,0] y = [0,1,0] z = [0,0,1]
Take a 3d vector Z
rotate Z around z axis
rotate Z around x axis
double magnitude of Z
add a constant vector C

You don't double the magnitude of Z, you square it. As pointed out in the previous comment, it's not clear what you mean by "rotating around the z or x axis".


Title: Has anyone tried this formula?
Post by: twinbee on November 26, 2009, 04:54:53 PM
Ted, if I understand you correctly, are you saying that as the angle approaches the poles (singularities), the distance travelled will be proportionally much greater, so as to obtain the same spherical distance (http://mathworld.wolfram.com/SphericalDistance.html) as travelled around theta (even if it means going round in circles a lot near the poles)? If this is the case, directly at the north/south poles, infinite 'rotations' around phi will take place in theory. Is this correct?

If you do mean that, then I have tried that already, without success. However, it may be worth trying again, in case I made a math slip up.

Good thinking in any case.


Title: Re: Has anyone tried this formula?
Post by: TedWalther on November 26, 2009, 08:40:38 PM
Ted, if I understand you correctly, are you saying that as the angle approaches the poles (singularities), the distance travelled will be proportionally much greater, so as to obtain the same spherical distance (http://mathworld.wolfram.com/SphericalDistance.html) as travelled around theta (even if it means going round in circles a lot at the poles)? If this is the case, at the north/south pole, infinite 'rotations' will take place in theory. Is this correct?

If you do mean that, then I have tried that already, without success. However, it may be worth trying again, in case I made a math slip up.

Good thinking in any case.

I'm not sure I explained myself clearly; its been a while.  I'll have another go at it:

Quote
n = 2 ; exponent

;; for each iteration:

rxyz = sqrt(Zx2+Zy2+Zz2)  ; magnitude of entire vector
ryz = sqrt(Zy2 + Zz2) ; magnitude of yz component of vector

theta = n*arccos(Zx/rxyz)
phi = n*arccos(Zy/ryz)

x = rxyzn * cos(theta) + Cx
y = rxyzn * sin(theta) * cos(phi) + Cy
z = rxyzn * sin(theta) * sin(phi) + Cz

My math is rusty, so if I got that wrong, please be patient.

To put it into words again:

Take the point Z.  It has x,y,z components.  Except when Z is colinear with [1,0,0] (the x axis, I will call it X), Z and X together always define a plane.  Rotate Z in that plane.  Then ignore the x component of Z, and when the [y,z] subset of Z is not colinear with the y axis [0,1,0] (which I call Y), then rotate just the [y,z] subset in the yz plane, using the y axis itself as the zero angle.

Has this already been tried?

Oh, about the north and south poles... When Z is colinear with X, it shouldn't rotate at all.  When the y,z components of Z are colinear with Y, there is no rotation in the yz plane.  So, yes, near the poles the points should rotate quite quickly, but when they get to zero there should be no rotation at all.

Ted


Title: A second formula, 3d complex (NOT quaternions)
Post by: TedWalther on November 26, 2009, 09:09:37 PM
I came up with another possibility, based on extending imaginary numbers.  Instead of the quaternion identity ijk, I based it on this identity:

Quote
i2 = -1 ; y axis
j2 = -1 ; z axis
ij = ji ; little bit that isn't represented graphically but just hangs around to take part in calculations

So, taking that as the basis, I came up with the following iteration:

Quote
initialize
Z = [0,0,0,0]

iterate:

Znx = Zx2 - Zy2 - Zz2 + Zt2 + Cx
Zny = 2(ZxZy - ZzZt) + Cy
Znz = 2(ZxZz - ZyZt) + Cz
Znt = 2(ZxZt + ZyZz)

For rendering and distance calculations, ignore Zt

That iteration formula represents Z2 + C for the given definitions of i and j.

Are there any images of that kicking around?


Title: Re: Has anyone tried this formula?
Post by: msltoe on November 26, 2009, 11:56:42 PM
Ted,

 Paul Nylander does a very good job on his web site showing some of the different variations of the 4-D quaternion "mandelbrot" sets. I think the last one you suggested is on there.

http://www.bugman123.com/Hypercomplex (http://www.bugman123.com/Hypercomplex)

 Unfortunately, none of the quaternion variations that people have looked at so far produce anything as exciting as the Mandelbulb.

-mike


Title: Re: Has anyone tried this formula?
Post by: TedWalther on November 27, 2009, 01:15:50 AM
Ted,

 Paul Nylander does a very good job on his web site showing some of the different variations of the 4-D quaternion "mandelbrot" sets. I think the last one you suggested is on there.

http://www.bugman123.com/Hypercomplex (http://www.bugman123.com/Hypercomplex)

 Unfortunately, none of the quaternion variations that people have looked at so far produce anything as exciting as the Mandelbulb.

-mike

Thanks Mike.

I was just looking at it now; there are several that are similar to mine, but the difference is in whether the terms are added or subtracted.  Specifically, the 4d "roundy" and "squary" mandelbrots are similar in formula, but the terms are added and subtracted differently from mine.  I don't know how the roundy and squary formulas were derived; my formula was derived from treating j and i as types that behave in the same way but don't interact with each other.  Just changing the signedness of a couple terms was enough to convert a roundy to a squary; just two or three more terms need their signedness changed to match my formula; who knows what it will turn out to look like?

Here is the differences:

Quote
Roundy: {x2-y2-z2-w2, 2(xy+zw), 2(xz+yw), 2(xw+yz)}
Squary: {x2-y2-z2-w2, 2(xy+zw), 2(xz+yw), 2(xw-yz)}
Cousin: {x2-y2-z2+w2, 2(xy+zw), 2(xz+yw), 2(xw+yz)}
Variation:  {x2-y2-z2-w2, 2(xy+zw), 2(xz-yw), 2(xw+yz)}
Ted's: {x2-y2-z2+w2, 2(xy-zw), 2(xz-yw), 2(xw+yz)}

Some of those quaternions were mandelbrot-like enough to make me excited, and I anxiously await for someone else to be curious enough to render and post images of my variation.

To summarize:

Quote
The x term:
x2-y2-z2-w2 roundy, squary, variation
changes the -w2  to +w2 : cousin, ted's

The y term:
2(xy+zw) : roundy, squary, cousin, variation
2(xy-zw) : ted's

The z term:
2(xz+yw): roundy, squary, cousin
2(xz-yw): variation, ted's

The w term:
2(xw-yz): squary
2(xw+yz): roundy, cousin, variation, ted's

Roundy different in 3 terms, Squary different in 4 terms, Cousin different in 2 terms, Variation different in 2 terms.

Ted


Title: Re: Has anyone tried this formula?
Post by: dougfractal on November 27, 2009, 01:30:33 AM
This is my formula

(http://4.bp.blogspot.com/_RtmvIFH1wRs/Sw8a4t8knHI/AAAAAAAAAEE/Jm0tnxd_hj4/s1600/doughowto.jpg)

Also expandable to multi-dimensions.

(http://www.fractaldimension.org.uk/templates/dimensions/images/template_r1_c1.jpg)


3D
http://www.youtube.com/watch?v=fXFz2x7jUro

4D
http://www.youtube.com/watch?v=eS7qCfttmBk




Title: Re: Has anyone tried this formula?
Post by: TedWalther on November 27, 2009, 01:39:04 AM
Thanks dougfractal, that looks intriguing.  Can you post the formula?  Also, can you re-read my post immediately above; I just added some information to it which should make it clear how it differs from the other quaternion-esque mandels.


Title: Re: Has anyone tried this formula?
Post by: msltoe on November 27, 2009, 01:41:48 AM
Ted: Here's a quick rendering of your quaternion formula:
 


Title: Re: A second formula, 3d complex (NOT quaternions)
Post by: TedWalther on November 27, 2009, 01:48:40 AM
I came up with another possibility, based on extending imaginary numbers.  Instead of the quaternion identity ijk, I based it on this identity:

Quote
i2 = -1 ; y axis
j2 = -1 ; z axis
ij = ji ; little bit that isn't represented graphically but just hangs around to take part in calculations

The result of squaring a number that involves i and j using these rules:

Quote
(a+bi+cj+dij)2 = a2-b2-c2+d2+2(ab-cd)i+2(ac-bd)j+2(ad+bc)ij

So, taking that as the basis, I came up with the following iteration:

Quote
initialize
Z = [0,0,0,0]

iterate:

Znx = Zx2 - Zy2 - Zz2 + Zt2 + Cx
Zny = 2(ZxZy - ZzZt) + Cy
Znz = 2(ZxZz - ZyZt) + Cz
Znt = 2(ZxZt + ZyZz)

For rendering and distance calculations, ignore Zt

That iteration formula represents Z2 + C for the given definitions of i and j.

THANK YOU MIKE for publishing that image.  Best Thanksgiving gift ever!  Very exciting.  Wish there was linux software that could do these renders.  At that level it does look like there are a lot of smooth areas.  But for symmetry, it looks pretty much like what I expect a 3d mandelbrot to look like.  Now if I could only get a look at the first fractal, the non-quaternion one, with the sines and cosines.


Title: Re: Has anyone tried this formula?
Post by: TedWalther on November 27, 2009, 02:02:43 AM
Mike, I checked my notes, and I made a mistake in the w term; can you try again with 2(xw-yz) changed to 2(xw+yz) ?  In case you look, I have already made correction to my previous previous posts.

Also, in the post above, I accidentally repeated material from a previous post, but I added in the expansion of the square of the pseudo-quaternions I've been using, this should make it easier to see how I got the iteration formula.

Ted


Title: Re: Has anyone tried this formula?
Post by: msltoe on November 27, 2009, 02:43:22 AM
Ted,
 
 Your welcome. Actually, I was thinking of sharing my rudimentary Linux-based C renderer with everyone which I've been working on for the past two weeks as I've been feverishly looking for the holy grail of 3-D mandelbrots.

Here's your second quaternion render:
 


Title: Re: Has anyone tried this formula?
Post by: msltoe on November 27, 2009, 03:00:55 AM
Ted,


 Here's your first one in 2nd order. The 8-th order looks like a typical 8th-order Mandelbulb. There's something about those Higher Powers...


Title: Re: Has anyone tried this formula?
Post by: TedWalther on November 27, 2009, 03:04:26 AM
Thanks again, Mike.  I think the first (mistaken) quaternion looks a lot better than the second (correct) quaternion.  Observing the differences between the different pseudo-quaternion formulas, it looks like they only differ in the signedness of the terms.  Since there are ten terms, there are 1024 different possibilities.

It would be interesting to iterate through all 1024 possibilities and see how they differ.  One could just iterate from 0 to 1023 and treat the index as a bitmap, with 0 representing + and 1 representing -

Mike, what software are you using?  Does it run on Linux?  Are you generating voxels or following a ray outwards from the screen?  I'd like to start rendering fly-arounds of each object.

Ted


Title: Re: Has anyone tried this formula?
Post by: TedWalther on November 27, 2009, 03:16:09 AM
Ted,


 Here's your first one in 2nd order. The 8-th order looks like a typical 8th-order Mandelbulb. There's something about those Higher Powers...

That is beautiful.  Reminds me and a co-worker of the female uterus lying on its side.  Should we call it the Valentine's Mandelbulb?

How does 3rd order look?  I was expecting that order-2 might not be the best, just because order-2 worked for a 2 dimensional thing, and we are operating in 3d now.

Ted


Title: Re: Has anyone tried this formula?
Post by: dougfractal on November 27, 2009, 03:26:58 AM
I've just published my code

http://code.google.com/p/fractaldimension/ (http://code.google.com/p/fractaldimension/)

The java code includes 4D and 5D functions

but here is my original 3D algorithm

Quote
i.j = -j
j.i =  i


Code:
	public int iterate3D(double rec,double imc, double jmc,int max)
{ double re,im,re2,im2,jm,jm2,ij,tmp;
int itr=0;
double mag=.0;
im=re=jm=re2=im2=jm2=.0;
do {
ij=im*jm;
tmp=re2-im2-jm2+rec;
im=2.0f*im*re-ij+imc;
jm=2.0f*jm*re+ij+jmc;
re=tmp;
re2=re*re;
im2=im*im;
jm2=jm*jm;
itr++;
if (itr>max) break;
mag=re2+im2+jm2;
} while (4.0f>mag );
return itr;
}


Title: Re: Has anyone tried this formula?
Post by: TedWalther on November 27, 2009, 08:24:05 AM
Thank you for the code, Doug.  Can you tell us a but more about how you derived that code?  Any particular theory or reasoning behind how you decided on the particular relationship of j and i?


Title: Re: Has anyone tried this formula?
Post by: dougfractal on November 27, 2009, 06:33:36 PM
http://www.fractaldimension.org.uk/voldsitemirror/ (http://www.fractaldimension.org.uk/voldsitemirror/)

Different Complex Numbers
With the understanding that [imaginary number i] can be represented by rotation of 90° about the origin. I defined [imaginary number j] as a rotation of 90° about the origin and a rotation of 90° with respect to .
So with this in mind I picked up a cube, to help me visualise the rotations, and then recorded the results.

(http://www.fractaldimension.org.uk/voldsitemirror/ij.gif)
I rotated it upwards 90° , then following it by turning it a different 90° backwards [j], I defined the result:

   i × j = -j     

Then starting again
(http://www.fractaldimension.org.uk/voldsitemirror/ji.gif)
I rotated 90° backwards [j], followed by 90° upwards . This gave me the result:

    j × i = i

It is the use of these results when applied into the [Mandelbrot algorithm], that produce the [Bristor set]. Imaginary numbers in additional dimensions can be derived by substituting in the new number in the above equations.


Title: Youtube video
Post by: TedWalther on November 27, 2009, 07:43:57 PM
Animation, 15 frames per second.  The value of n in Zn starts at 0.11 and goes up to 9.00 in increments of 0.01.  Thanks to Mike for the code to calculate and render the images that went into this video.

http://www.youtube.com/watch?v=np4MPGtr7eU


Title: Re: Has anyone tried this formula?
Post by: JosLeys on November 27, 2009, 08:09:47 PM
Here is a picture of a degree 8 Bristorbrot


Title: Re: Has anyone tried this formula?
Post by: JosLeys on November 27, 2009, 10:09:12 PM
As far as I know, Doug Bristor's formula is the only one I've seen whereby a slice in both the xy and xz plane produces the familiar 2D Mandelbrot.
It produces some interesting Julia's as well.This one is degree 3 :


Title: Re: Has anyone tried this formula?
Post by: David Makin on November 27, 2009, 10:26:55 PM
As far as I know, Doug Bristor's formula is the only one I've seen whereby a slice in both the xy and xz plane produces the familiar 2D Mandelbrot.
It produces some interesting Julia's as well.This one is degree 3 :


Hi Jos, see my 4D "Roundy" Mandelbrot on Paul's pages:

http://www.bugman123.com/Hypercomplex/ (http://www.bugman123.com/Hypercomplex/)

also here:

http://www.fractalforums.com/3d-fractal-generation/true-3d-mandlebrot-type-fractal/msg7358/#msg7358 (http://www.fractalforums.com/3d-fractal-generation/true-3d-mandlebrot-type-fractal/msg7358/#msg7358)

Also this one:

http://www.fractalforums.com/mandelbulb-renderings/i%27ve-got-something-promising/msg8838/#msg8838 (http://www.fractalforums.com/mandelbulb-renderings/i%27ve-got-something-promising/msg8838/#msg8838)



Title: Re: Has anyone tried this formula?
Post by: JosLeys on November 27, 2009, 10:48:46 PM
OK David, sorry..

In one of your posts you propose

   r   i   j
r  r   i   j
i  i  -r  -j
j  j  -j  -r

whereas Doug is using

   r   i   j
r  r   i   j
i  i  -r  -j
j  j   i  -r  (notice the 'i' in the last row)



Title: Re: Has anyone tried this formula?
Post by: David Makin on November 27, 2009, 11:42:06 PM
OK David, sorry..

In one of your posts you propose

   r   i   j
r  r   i   j
i  i  -r  -j
j  j  -j  -r

whereas Doug is using

   r   i   j
r  r   i   j
i  i  -r  -j
j  j   i  -r  (notice the 'i' in the last row)



I ignored non-commutative forms simply because I'm averse to them (more than I'm averse to say more than one number without an inverse). Also I was trying for something that broke the "ring" rule but still worked in both cross-sections :)

Plus I was rather pleased with this idea:

"i.e. here *i is a function that maps r to i (one dimension to another), *j is a function that maps r and i to j (two dimensions to a third), *k is a function that maps r, i and j to k (thrree dimensions to a fourth) etc."

I found that using commutative -j for i*j worked best IMO for the 3D case, of course if you want the higher dimensions to collapse correctly when one imaginary dimension is removed then the corresponding 4D should look like this:

   r   i   j   k
r  r   i   j   k
i  i  -r  -j  -k
j  j  -j  -r -k
k k  -k -k -r





Title: Re: Has anyone tried this formula?
Post by: dougfractal on November 28, 2009, 03:17:45 AM
To create my 4D fractal
http://www.youtube.com/watch?v=eS7qCfttmBk


I used substitution

    r  i    j   k
 r  r  i    j   k
 i  i  -r  -j  -k
 j  j   i  -r  -k
k k   i  -j  -r


One of the things I found most interesting is the diferent ways of viewing 4D.
here's the parallel view

http://www.youtube.com/watch?v=D7j-Fj7JozQ

here is a mirror to my old site which may explain more.
http://www.fractaldimension.org.uk/voldsitemirror/

I've also released my code here
http://code.google.com/p/fractaldimension/

The julia set rendering are also very interesting
http://fractaldimension.org.uk/oldsite/fractal.html
http://www.youtube.com/watch?v=pw8u_fJPOEU

I produced 5D in a  similar way to above.

















Title: Re: Has anyone tried this formula?
Post by: dougfractal on November 28, 2009, 04:36:37 AM
Quote
As far as I know, Doug Bristor's formula is the only one I've seen whereby a slice in both the xy and xz plane produces the familiar 2D Mandelbrot.

Also the Bristorbrot is symmetrical along the ij plane creating the 2 opposite pairs.
This symmetry is persevered on higher dimensional views.


Title: Re: Has anyone tried this formula?
Post by: JosLeys on November 28, 2009, 01:09:52 PM
Dave said:
Quote
I ignored non-commutative forms simply because I'm averse to them

Just this: we are playing with rotations of a point on a sphere, and those rotations are non-commutative by nature..

Just to clarify for those who doubt:

Rotate the point <1,0,0> around the (vertical) y-axis 90° gives you <0,0,1>, then rotate 90° around the x-axis and you get <0,1,0>

If we rotate first around the x-axis, the point does not move, and the subsequent rotation about the y-axis gets us <0,0,1>.

Different order, different result.


Title: Re: Has anyone tried this formula?
Post by: David Makin on November 28, 2009, 01:33:14 PM
Dave said:
Quote
I ignored non-commutative forms simply because I'm averse to them

Just this: we are playing with rotations of a point on a sphere, and those rotations are non-commutative by nature..

Just to clarify for those who doubt:

Rotate the point <1,0,0> around the (vertical) y-axis 90° gives you <0,0,1>, then rotate 90° around the x-axis and you get <0,1,0>

If we rotate first around the x-axis, the point does not move, and the subsequent rotation about the y-axis gets us <0,0,1>.

Different order, different result.

I know, I just like things to be commutative ;)

My latest attempt is not commutative though:

http://www.fractalforums.com/3d-fractal-generation/truerer-true-3d-mandelbrot-fractal-(search-for-the-holy-grail-continues)/msg9235/#msg9235 (http://www.fractalforums.com/3d-fractal-generation/truerer-true-3d-mandelbrot-fractal-(search-for-the-holy-grail-continues)/msg9235/#msg9235)

Edit: Aargh, I was mistaking commutivaty of the function with commutivaty of the rotations performed - obviously the rotations are not commutative but if the "multiply" function takes a similar form to that for the Mandelbulb then it is commutative :)


Title: Re: Has anyone tried this formula?
Post by: dougfractal on November 28, 2009, 05:10:12 PM
Matrix multiplication and division are both examples of non-commutative maths.

(http://lh4.ggpht.com/_RtmvIFH1wRs/Sw75lAC9LOI/AAAAAAAAACw/W8_OhAi31qQ/webphotofmodel.jpg)

I know when I showed mathematicians my model they tended to be less impressed than other philosophical people.
For me it was the nature the shape and form that confirms to me the formula. (not very mathematical I know).

It is the questions on how to best observe this complex shape that I find the most interesting, whether it be the (captured) Shape or the (contoured) Form. To see one obscures the other.

Then to 4D. To observe over time; evolution from beginning to end, or to observe the infinite unique (except i=0 or j=0) parallel models.



Title: Re: Has anyone tried this formula?
Post by: twinbee on December 04, 2009, 02:30:40 PM
Another rendering of the quadratic version of Doug's formula (download 10meg 7000x7000 pixels (http://www.skytopia.com/project/fractal/new/bristorbulb.jpg)). Here's a preview:

(http://www.skytopia.com/project/fractal/new/bristorbulb-s.jpg)


Title: Re: Has anyone tried this formula?
Post by: jehovajah on December 06, 2009, 02:58:08 PM
Could someone do a rough render of this formula http://www.fractalforums.com/theory/transform-for-r3/ (http://www.fractalforums.com/theory/transform-for-r3/)

to compare it with this formula http://www.fractalforums.com/theory/choosing-the-squaring-formula-by-location/ (http://www.fractalforums.com/theory/choosing-the-squaring-formula-by-location/), please?   

 am curious to see what effect the power polynomials have such as here http://www.fractalforums.com/mandelbulb-renderings/a-degree-42-rational-function/ (http://www.fractalforums.com/mandelbulb-renderings/a-degree-42-rational-function/)  where i wonder if any computational error has to be considered for its effects on the result.