Welcome to Fractal Forums

Fractal Math, Chaos Theory & Research => General Discussion => Topic started by: Aexion on September 07, 2011, 06:36:37 PM




Title: Hyper-Dual Numbers
Post by: Aexion on September 07, 2011, 06:36:37 PM
Hello,

Here is a link that I have found on the web about Hyper-Dual Numbers..

http://www.stanford.edu/~jfike/hyperdual.html (http://www.stanford.edu/~jfike/hyperdual.html)

Perhaps those numbers can create interesting fractals.. hmm..

Right now I don't have time to play with them, but if someone found something interesting, please let me know. :)




Title: Re: Hyper-Dual Numbers
Post by: Jesse on September 07, 2011, 08:57:44 PM
Just proofed that pow(fikequat, 2) equals fikequat*fikequat  :dink:

So i try it tomorrow for a bulb, if time let me.


Title: Re: Hyper-Dual Numbers
Post by: Syntopia on September 07, 2011, 09:45:50 PM
A quick test using the code below (essentially Quaternion Mandelbrot code)

Code:
vec4 mul(vec4 a, vec4 b) {
return vec4( a.x*b.x, a.x*b.y + a.y*b.x, a.x*b.z+a.z*b.x,  a.x*b.w+a.y*b.z+a.z*b.y+a.w*b.x);
}

float DE(vec3 pos) {
vec4 p = vec4(pos,C4);
vec4 dp = vec4(1.0,0.0,0.0,0.0);
for (int i = 0; i < Iterations; i++) {
dp = 2.0* mul(dp,p) + vec4(1.0,0.0,0.0,0.0);
p = mul(p,p) + vec4(pos,C4);
float p2 = dot(p,p);
orbitTrap = min(orbitTrap, abs(vec4(p.xyz,p2)));
if (p2 > Threshold) break;
}
float r = length(p);
return  0.5 * r * log(r) / length(dp);
}

The Mandelbrot seemed more interesting than the Julias, but I didn't explore it much.


Title: Re: Hyper-Dual Numbers
Post by: cKleinhuis on September 07, 2011, 10:01:01 PM
nice he has done a nice c++ implementation of the operators:


http://www.stanford.edu/~jfike/fikecomp.h

just the good ole map 3dimensions to 4 who has the first render?!




Title: Re: Hyper-Dual Numbers
Post by: cKleinhuis on September 07, 2011, 10:04:18 PM
@syntopia how did you do that DE that fast ? i was thinking about hackin it into fragmentarium, but was frightened of the DE implementation, and didnt knew how to force brute force rendering,
and while i am on it, i had severe problems defining new "user controllable" variables, they where just not recognized "Could not find: xxx" ...


Title: Re: Hyper-Dual Numbers
Post by: Syntopia on September 07, 2011, 10:35:03 PM
@syntopia how did you do that DE that fast ? i was thinking about hackin it into fragmentarium, but was frightened of the DE implementation, and didnt knew how to force brute force rendering,
and while i am on it, i had severe problems defining new "user controllable" variables, they where just not recognized "Could not find: xxx" ...

I just assumed the standard DE for the 2D Mandelbrot/4D Quaternion/Mandelbulb. It seems to work, but you have to multiply by a low constant to avoid noise.

If you send me a mail (mikael at hvidtfeldts.net) with your Fragmentarium code (and your OS and repository/build version), I'll take a look at the error.

Btw, dual numbers were constructed for doing automatic differentiation. I saw in an old post here on FF, that fpsunflower applied this to calculate the gradient of the DE (for getting a surface normal). But I wonder, whether automatic differentation could be used to calculate the gradient in Buddhi/Makin's four-point formula? You would get rid of an arbitrary delta, and get better precision.

Unfortunately, you cannot implement new types in GLSL, so it would be difficult to implement in Fragmentarium, but there are libraries out there for C++. Just a thought.



Title: Re: Hyper-Dual Numbers
Post by: DarkBeam on September 20, 2011, 11:49:45 PM
The first render is quite discouraging,  :-\


Title: Re: Hyper-Dual Numbers
Post by: cKleinhuis on September 21, 2011, 08:48:29 AM
@darkie just see it as a transform, adding additional spice to hybrid possibilities...


Title: Re: Hyper-Dual Numbers
Post by: DarkBeam on September 21, 2011, 11:38:49 AM
@darkie just see it as a transform, adding additional spice to hybrid possibilities...


I made a transform with a similar effect, it screwed up almost all ;D ... Hope it's not the same for the new baby!


Title: Re: Hyper-Dual Numbers
Post by: DarkBeam on October 06, 2011, 06:07:56 PM
Too bad the original formula gave too weird results. I had to adapt it (eg rewrite :tease: )

Description:

Code:
This formula was inspired by:
http://www.fractalforums.com/general-discussion-b77/hyper-dual-numbers/
It is mathematically meaningless - but can give cool fractals

 // original formula:
 // a.x*b.x, a.x*b.y + a.y*b.x, a.x*b.z+a.z*b.x,  a.x*b.w+a.y*b.z+a.z*b.y+a.w*b.x
 // was too unregular - especially x component so I fixed
 
 a=x, b=y, c=z, d=w,  pow = IntPower-1;
 do { // do allows you to choose a higher pow
 newa = xa - yb - ( zc + wd ) - ( zd + wc )*zwMul; // instead of xa
 // if you remove yb and ( zc + wd ) you get weird things...
 newb = xb + ya;
 newc = xc + za + ( yd + wb )*ywMul;
 newd = xd + wa + ( yc + zb )*yzMul;
 pow--, a=newa, ... d=newd;
 } while pow>=0;
 x=a+Cx, y=b+Cy, z=c+Cz, w=d+Cw

Thanks anyway Aexion ;D