TedWalther
Guest
|
|
« 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
|
|
|
Logged
|
|
|
|
David Makin
|
|
« Reply #1 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.
|
|
« Last Edit: November 26, 2009, 04:01:06 PM by David Makin »
|
Logged
|
|
|
|
s31415
|
|
« Reply #2 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".
|
|
« Last Edit: November 26, 2009, 04:43:10 PM by s31415 »
|
Logged
|
|
|
|
twinbee
|
|
« Reply #3 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 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.
|
|
« Last Edit: November 26, 2009, 06:27:04 PM by twinbee »
|
Logged
|
|
|
|
TedWalther
Guest
|
|
« Reply #4 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 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: 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
|
|
« Last Edit: November 26, 2009, 09:23:02 PM by TedWalther, Reason: accidentally put sin(theta) when I meant sin(phi) »
|
Logged
|
|
|
|
TedWalther
Guest
|
|
« Reply #5 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: 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: 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 Z tThat iteration formula represents Z 2 + C for the given definitions of i and j. Are there any images of that kicking around?
|
|
« Last Edit: November 27, 2009, 02:21:09 AM by TedWalther, Reason: correcting signedness error in the w term »
|
Logged
|
|
|
|
msltoe
Iterator
Posts: 187
|
|
« Reply #6 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 Unfortunately, none of the quaternion variations that people have looked at so far produce anything as exciting as the Mandelbulb. -mike
|
|
|
Logged
|
|
|
|
TedWalther
Guest
|
|
« Reply #7 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 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: 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: 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
|
|
« Last Edit: November 27, 2009, 02:14:43 AM by TedWalther, Reason: Correcting the w term; signedness error. »
|
Logged
|
|
|
|
dougfractal
Guest
|
|
« Reply #8 on: November 27, 2009, 01:30:33 AM » |
|
|
|
|
Logged
|
|
|
|
TedWalther
Guest
|
|
« Reply #9 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.
|
|
|
Logged
|
|
|
|
msltoe
Iterator
Posts: 187
|
|
« Reply #10 on: November 27, 2009, 01:41:48 AM » |
|
Ted: Here's a quick rendering of your quaternion formula:
|
|
|
|
TedWalther
Guest
|
|
« Reply #11 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: 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: (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: 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 Z tThat iteration formula represents Z 2 + 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.
|
|
« Last Edit: November 27, 2009, 02:01:07 AM by TedWalther, Reason: mistook sign for w term »
|
Logged
|
|
|
|
TedWalther
Guest
|
|
« Reply #12 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
|
|
« Last Edit: November 27, 2009, 02:19:41 AM by TedWalther »
|
Logged
|
|
|
|
msltoe
Iterator
Posts: 187
|
|
« Reply #13 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:
|
|
|
|
msltoe
Iterator
Posts: 187
|
|
« Reply #14 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...
|
|
|
|
|