Jesse
Download Section
Fractal Schemer
Posts: 1013
|
|
« on: January 26, 2010, 01:02:41 AM » |
|
I am wondering why this is not working: doing the triplex sqaring two times and adding the constant afterwards, doesnt gives the result of the power 4 bulb (all with positive z). But there are several more pow8 bulbs this way by combining -Z and -Y Versions with the positive ones. Here is one i like, although the disconnectivity and some other things pointing out that it is more an experimental one:
|
|
|
Logged
|
|
|
|
David Makin
|
|
« Reply #1 on: January 26, 2010, 02:01:04 AM » |
|
doing the triplex sqaring two times and adding the constant afterwards, doesnt gives the result of the power 4 bulb (all with positive z).
That's because the algebra is not associative in cartesian form - so if you convert to magnitudes and angles and compute say z^2*z (without intermediate conversion to cartesian form) then the result will be z^3 but if you compute z^2 in cartesian form then z^2*z != z^3. This also means that there is no way to make triplex numbers generally associative so a*(b+c) is not a*b+a*c for all values - this even means that you can't for example expand (a+b)^2 as a^2+2*a*b+b^2 if a and b are triplex ! It does mean that we get extra fractal formulas though - such as your twice squared one
|
|
|
Logged
|
|
|
|
Timeroot
|
|
« Reply #2 on: January 26, 2010, 03:29:36 AM » |
|
Yeah, I'm still not really getting that. What do you mean by "multiplying in Cartesian form"?
|
|
|
Logged
|
Someday, man will understand primary theory; how every aspect of our universe has come about. Then we will describe all of physics, build a complete understanding of genetic engineering, catalog all planets, and find intelligent life. And then we'll just puzzle over fractals for eternity.
|
|
|
Paolo Bonzini
Guest
|
|
« Reply #3 on: January 26, 2010, 02:46:44 PM » |
|
Yeah, I'm still not really getting that. What do you mean by "multiplying in Cartesian form"? See the last 5-10 messages in the top sticky thread.
|
|
|
Logged
|
|
|
|
Jesse
Download Section
Fractal Schemer
Posts: 1013
|
|
« Reply #4 on: January 27, 2010, 03:03:33 PM » |
|
Thanks, David. I guess the nonassociativity is due to the "packing" of j in i, so we have to unpack and pack or transform to polar coordinates and back every time to multiply. Ok, as Paolo has stated, this is already discussed.
Another question to David, are you calculating in UF with quaternions, because it looks so. But i am not familiar with UFs algebra.
By now i am using whites formula for the P8 bulb, giving a speed increment by a factor 3.5 over the direct trigonometric calculation.
|
|
|
Logged
|
|
|
|
Paolo Bonzini
Guest
|
|
« Reply #5 on: January 27, 2010, 03:36:56 PM » |
|
I guess the nonassociativity is due to the "packing" of j in i
No, it is due to rotations being "twice as many" as sphere points. The former has elevation in the (-pi,pi) range, the latter has it in (-pi/2,pi/2). unpack and pack or transform to polar coordinates and back every time to multiply
Unpacking/packing is exactly what causes the nonassociativity.
|
|
|
Logged
|
|
|
|
David Makin
|
|
« Reply #6 on: January 27, 2010, 03:42:27 PM » |
|
Thanks, David. I guess the nonassociativity is due to the "packing" of j in i, so we have to unpack and pack or transform to polar coordinates and back every time to multiply. Ok, as Paolo has stated, this is already discussed.
Another question to David, are you calculating in UF with quaternions, because it looks so. But i am not familiar with UFs algebra.
By now i am using whites formula for the P8 bulb, giving a speed increment by a factor 3.5 over the direct trigonometric calculation.
I'm not using quaternions, but I am using a method that uses complex - that's basically because UF is designed and optimised for handling complex numbers, so complex z^2 for instance is automatically "inlined" - actually in UF the algebraic method is inlined for z^2, z^3 and z^4 - that should explain the way I've written my optimised 'bulb code If you look at the way I've done the standard bulb you'll notice that although I convert x+i*y to a unit vector, I do not convert sqrt(x^2+y^2) + i*z to a unit vector - this is because the magnitude of sqrt(x^2+y^2) + i*z is in fact the same as that of the full triplex so when we raise this to the power it not only applies the angle change but also raises the magnitude to the power. (Note that in my UF formula x+iy appears as the complex variable zri and z as the float variable zj).
|
|
|
Logged
|
|
|
|
Jesse
Download Section
Fractal Schemer
Posts: 1013
|
|
« Reply #7 on: January 27, 2010, 11:21:45 PM » |
|
I'm not using quaternions, but I am using a method that uses complex - that's basically because UF is designed and optimised for handling complex numbers, so complex z^2 for instance is automatically "inlined" - actually in UF the algebraic method is inlined for z^2, z^3 and z^4 - that should explain the way I've written my optimised 'bulb code If you look at the way I've done the standard bulb you'll notice that although I convert x+i*y to a unit vector, I do not convert sqrt(x^2+y^2) + i*z to a unit vector - this is because the magnitude of sqrt(x^2+y^2) + i*z is in fact the same as that of the full triplex so when we raise this to the power it not only applies the angle change but also raises the magnitude to the power. (Note that in my UF formula x+iy appears as the complex variable zri and z as the float variable zj). Sounds very smart, i have to study this a while to get the point.
|
|
|
Logged
|
|
|
|
Timeroot
|
|
« Reply #8 on: January 28, 2010, 01:48:21 AM » |
|
I guess the nonassociativity is due to the "packing" of j in i
No, it is due to rotations being "twice as many" as sphere points. The former has elevation in the (-pi,pi) range, the latter has it in (-pi/2,pi/2). Unpacking/packing is exactly what causes the nonassociativity. [/quote] If I understand correctly (this is the last time I'll bother, sorry I'm slow at understanding) this only applies to the "latitude" - adding 80 degrees latitude to 80 degrees latitude produces -40 degrees latitude the next time, while adding 180 to longitude. Adding 80 again leaves you with 40 degrees latitude. On the other hand, adding 80 to 80, then again to 80 gives 240 which is reduced to -60 degrees latitude, while adding 180 to longitude. ... This makes me think of several possible coordinate systems I posted in the "Alternate Coordinate Systems" thread (First post), one with 4 poles (the two "North" poles are perpendicular to one another, all lying in a common plane). Since it would function very similar to the Triplex numbers, while using only longitude, I'd be willing to bet it would form a complete algebra and be distributive. Many mathematical operations would be simpler there. Hopefully...
|
|
|
Logged
|
Someday, man will understand primary theory; how every aspect of our universe has come about. Then we will describe all of physics, build a complete understanding of genetic engineering, catalog all planets, and find intelligent life. And then we'll just puzzle over fractals for eternity.
|
|
|
David Makin
|
|
« Reply #9 on: January 28, 2010, 02:54:26 AM » |
|
I'm not using quaternions, but I am using a method that uses complex - that's basically because UF is designed and optimised for handling complex numbers, so complex z^2 for instance is automatically "inlined" - actually in UF the algebraic method is inlined for z^2, z^3 and z^4 - that should explain the way I've written my optimised 'bulb code If you look at the way I've done the standard bulb you'll notice that although I convert x+i*y to a unit vector, I do not convert sqrt(x^2+y^2) + i*z to a unit vector - this is because the magnitude of sqrt(x^2+y^2) + i*z is in fact the same as that of the full triplex so when we raise this to the power it not only applies the angle change but also raises the magnitude to the power. (Note that in my UF formula x+iy appears as the complex variable zri and z as the float variable zj). Sounds very smart, i have to study this a while to get the point. Just to help a little - a normal complex z^p is exactly the same as raising the magnitude of z to p and changing the cosine component (in x) and the sine component (in y) to the cosine and sine of the angle of z multiplied by p. So when we want the angles multiplied up for the Mandelbulb we can use the components we need for the atan2 as a complex number and raise the complex number to a power - if the number used is first normalised then it's purely the sine and cosine. So for theta we use ((x+i*y)/cabs(x+i*y))^p and for phi we could use ((sqrt(x^2+y^2)+i*z)/cabs(sqrt(x^2+y^2)+i*z))^p and then combine the results (real part == cosine, imaginary = sine) with the new magnitude i.e. sqrt(x^2+y^2+z^2)^p but as I pointed out cabs(sqrt(x^2+y^2)+i*z) is exactly the same as sqrt(x^2+y^2+z^2) so in fact I do not normalise the phi term before raising to a power which avoids the divide and automatically takes care of including the new magnitude.
|
|
|
Logged
|
|
|
|
Paolo Bonzini
Guest
|
|
« Reply #10 on: January 28, 2010, 10:14:06 AM » |
|
I guess the nonassociativity is due to the "packing" of j in i
No, it is due to rotations being "twice as many" as sphere points. The former has elevation in the (-pi,pi) range, the latter has it in (-pi/2,pi/2). Unpacking/packing is exactly what causes the nonassociativity. If I understand correctly (this is the last time I'll bother, sorry I'm slow at understanding) this only applies to the "latitude" Yes (what I called "elevation", i.e. phi). This makes me think of several possible coordinate systems I posted in the "Alternate Coordinate Systems" thread
That's a way to solve it, yes. Another is just to use quaternions to describe rotations, since they do it very well, and purely imaginary quaternions for points in the space.
|
|
|
Logged
|
|
|
|
|