Softology
|
|
« Reply #15 on: June 20, 2010, 03:26:44 AM » |
|
theta=atan2(sx+flip(sqrt(sz^2+sy^2))); phi=atan2(sy+flip(sz));
I wanted to give these a go, but I need a tip for the atan2 and flip parts of the above quoted code. Normally arctan2 takes 2 varialbles (y,x). How does chaospro handle atan2? How would I modify atan2 into the usual arctan2 syntax? Also what does flip do? How would that be implemented as a non chaospro procedure/function? Thanks, Jason.
|
|
|
Logged
|
|
|
|
Buddhi
|
|
« Reply #16 on: June 20, 2010, 09:06:38 AM » |
|
theta=atan2(sx+flip(sqrt(sz^2+sy^2))); phi=atan2(sy+flip(sz));
I wanted to give these a go, but I need a tip for the atan2 and flip parts of the above quoted code. Normally arctan2 takes 2 varialbles (y,x). How does chaospro handle atan2? How would I modify atan2 into the usual arctan2 syntax? Also what does flip do? How would that be implemented as a non chaospro procedure/function? flip(x) produces imaginary part of complex number. It means: atan2(x + flip(y)) you should convert to arctan2(y,z) because: atan2(x + flip(y)) = atan2(x + iy) = arctan2(y,x) Finally you have: theta = arctan2(sqrt(sz^2+sy^2),sx) phi = arctan2(sz,sy) Please correct me if I'm wrong
|
|
|
Logged
|
|
|
|
twinbee
|
|
« Reply #17 on: June 20, 2010, 07:41:17 PM » |
|
The smooth sections are pretty much a 2d version of whipped cream. Probably indicates that the 2d Mandelbrot set isn't the "Real 2d Mandelbrot" set after all, ehh? :p I've spoken in the past about the very thing you've mentioned, but the thing is: with the 2D Mandelbrot, these 'smooth' sections disintegrate with further iterations (as I'm sure you know). However, with your new 3D bulb algorithm, the smoothness never goes no matter how iterations you use (or at least, it goes in one or two dimensions, but not the others, which would cause a 'stretched' look (as seems to be evident here)). It's hard to imagine the real thing, but I am expecting a much more crystalline look to the texture, and very unusual intricate 3D whirlpool or spiral staircase sections with mini spiral staircases hanging off. Other sections would look very maze-like with and/or foamy, but good-foamy with stunning variety. Like I said, barely imaginable, but you won't mistake it when you see it. I really like the golf-ball shots though.
|
|
|
Logged
|
|
|
|
M Benesi
|
|
« Reply #18 on: June 20, 2010, 07:46:24 PM » |
|
Finally you have: theta = arctan2(sqrt(sz^2+sy^2),sx) phi = arctan2(sz,sy) Please correct me if I'm wrong Your statement is correct.
|
|
|
Logged
|
|
|
|
M Benesi
|
|
« Reply #19 on: June 20, 2010, 08:28:08 PM » |
|
I've spoken in the past about the very thing you've mentioned, but the thing is: with the 2D Mandelbrot, these 'smooth' sections disintegrate with further iterations (as I'm sure you know). However, with your new 3D bulb algorithm, the smoothness never goes no matter how iterations you use (or at least, it goes in one or two dimensions, but not the others, which would cause a 'stretched' look (as seems to be evident here)). Hi twinbee. I'm not entirely sure what you're getting at. As you increase iterations, the smooth sections become smaller, just like in a normal 2d mandelbrot. If you zoom into them, they are still smooth (just like 2d Mandelbrots). Here is a quick image of a 2d z^3 zoom, with different colors for each iteration (purple=50, blue-green=49, orange=48, white=47, pinkish beige=46), you can see the complexity increase as iterations increase. However, the smooth sections always remain (although if you zoomed out from this image, it would appear to lack smoothness, but it would still have the smooth sections). For 3d Mandelbrots, we don't usually iterate way past the point of smoothness, because when we do we end up with a chaotic hairy mess (in the more complex parts). The only way to avoid any smooth sections would be to combine fractals with differing total iterations into one image (I think some people have been doing this, but I haven't). It's hard to imagine the real thing, but I am expecting a much more crystalline look to the texture, and very unusual intricate 3D whirlpool or spiral staircase sections with mini spiral staircases hanging off. Other sections would look very maze-like with and/or foamy, but good-foamy with stunning variety. Like I said, barely imaginable, but you won't mistake it when you see it. You mean like this: I really like the golf-ball shots though.
Yeah, they look pretty hilarious. Almost as funny as writing an excessively complex formula and ending up with a simple variation of another formula.
|
|
|
Logged
|
|
|
|
M Benesi
|
|
« Reply #20 on: June 21, 2010, 03:29:18 AM » |
|
All right, I've been working on the math, writing out the formulas algebraically to see why certain z^n work and others don't. I'm using the atan2 (x+i*y) format to avoid confusing anyone with division by zero... Like Buddhi said, atan2 (x + iy) = arctan (y/x), the main difference being it avoids potential division by zero errors/confusion, which is why it is sometimes preferential to use this syntax. cos (atan2 (x+ i*y) * 2) = -1 when x=0 and 1 when y=0 sin (atan2 (x+ i*y) *2) = 0 when x or y = 0 cos (atan2 (x+ iy) * 3) = 0 when x= 0 and 1 when y=0 sin (atan2 (x+ iy) * 3) = -1 when x= 0 and 0 when y=0 (this is the first n that has symmetry: but not perfect symmetry like z^5) I think we can correct the lack of symmetry with a simple -1 multiplier.... we will see. cos (atan2 (x+iy) *4 ) (didn't do the math yet, isn't symmetric anyways) cos (atan2 (x+iy) *5 ) =0 when x=0 and 1 when y=0 (This is the first all around perfect symmetry) sin (atan2 (x+iy) *5 ) =1 when x=0 and 0 when y=0 Now the idea I am messing with now is not a solution for the irregularity of the even n z^ n, but it may extend the regularity of the odd n z^ n. I am going to multiply the cosine variables by -1 and see what happens for z^3 (well, I already did it with 1 cosine variable (sx vs i* sqrt(y^2+z^2), and it is interesting, I just sometimes get caught up in writing out random BS to amuse myself....). Here is an image of the z^3 with the one -1 multiplier to the cosine: When I multiply both cosines by -1, I get large smooth areas that are along the lines of what twinbee mentioned, but it might be due to negative absolute value pixel assignments... I'll check it out. Anyways, I made an all cosine version to try out with z^3... etc. It has effects on z^3... but interestingly enough, has absolutely no effect on z^5s.. With the all cosine version, I multiplied the sx and sy values by -1 and came up with this interesting twisty variety (for z^3) that has large smooth areas in addition to awesome fractally areas. I don't think it's necessary to use the all cosine version (I think I replicated it with the regular version multiplying the sy and sz values by -1, or something like that, but I forget and don't feel like checking at the moment).
|
|
« Last Edit: June 21, 2010, 06:57:22 AM by M Benesi »
|
Logged
|
|
|
|
twinbee
|
|
« Reply #21 on: June 22, 2010, 03:42:25 PM » |
|
If you zoom into them, they are still smooth (just like 2d Mandelbrots). I mean though if you don't zoom in. As you increase iterations even in your new formula, there are parts which remain smooth, unlike the standard 2D Mandelbrot. You mean like this: Not really no. The closest I've ever found to what I'm envisaging would be something like this Quasi-fuchsian fractal: For example, in one of your latest picture, there are stretched areas that will never become unstretched, no matter how many iterations you use (and even if you don't zoom in). The detail will become more strand-like, but at least one of the dimensions will be whipped cream, like the quaternion fractals. See below for details:
|
|
|
Logged
|
|
|
|
M Benesi
|
|
« Reply #22 on: June 22, 2010, 09:27:08 PM » |
|
Edited to add: The quasi fuchsian fractal has blank circular areas... doesn't it? Anyways... I see what you mean!! just got it (after writing out a reply which addressed something else). I thought you were talking about the "distortion" of the basic pattern.... In 3d rotation based fractals you will have areas in which the angular magnitudes (angle of x vs y, angle of x vs z, and angle of y vs. z) mute or negate the effects of one another, which results in non-detailed "stretched areas" (lines, or 3d strands) and non-detailed "blank" spots instead of fractally interactions. If you keep zooming perfectly into the exact location of the stretched area, you won't ever hit fractallyness, but perhaps if you veer to the side a bit you will leave the zone of angular cancelation (zoom enough and high enough iterations). Working on a really deep zoom into one of your stretches. I went onto a strand in between an outer strand and an inner strand. Details did not start to emerge until ~23+ iterations. Here is a 26 iteration, 8x z resolution, small shot (takes too long to make a big one): Just keep on zooming into a stretch (veer off to the side a bit to avoid the area of perfect angular cancelation, which is "wide" until you get to sufficient iterations) and you will find details. Note that doing tons of iterations (20+ to me) takes a long time, the 444x444 image took 4 minutes on my 2 gig core 2 duo.... but you might have a better CPU, or a modern GPU. Wow, I am deep zooming into a strand (stretched area) right now, and it took 36 iterations (very deep) before it started showing details. What I am wondering is.. in about 10 years when we can real-time deep zoom 100s of iterations... will the "stretched areas" have the most interesting emergent patterns? Here is the strand at 38 iterations, with the fractal details emerging from between strands (still not high enough iteration or resolution, but it took ~9+ minutes to calculate this small image):
|
|
« Last Edit: June 22, 2010, 10:32:55 PM by M Benesi »
|
Logged
|
|
|
|
jehovajah
|
|
« Reply #23 on: June 23, 2010, 04:21:31 AM » |
|
Some really cool work matt. If anybody is going to get close to designer mandelbulbs it might as well be you. There is a difference between our imagination and our implementation, and the same formula produces an infinite variety of outcomes depending on how it is implemented. For example i found that if i used arcsin() to find the angles as opposed to arctan() i got different mandelbulbs. I explored all the variations out there and realised that the mandelbulb is a product of our implementation of the formula. So try r^2(cos(2ø)+i sin(2ø))+c for different ways of obtaining ø to see what i mean. Good luck and good fortune and keep up the excellent analysis.
|
|
|
Logged
|
May a trochoid of ¥h¶h iteratively entrain your Logos Response transforming into iridescent fractals of orgasmic delight and joy, with kindness, peace and gratitude at all scales within your experience. I beg of you to enrich others as you have been enriched, in vorticose pulsations of extravagance!
|
|
|
M Benesi
|
|
« Reply #24 on: June 23, 2010, 05:12:41 AM » |
|
Thanks jehovajah, I actually have tried a bunch of variations over time. While in this thread I started thinking about the implications of various angular multiples, and realized that only with a multiple of (4n + 1) * the angle do we end up back at the original angle, at least for pi/4 (90 degrees), which is the reason that only z^5,9,13.... Bulbs are completely symmetric over all axes. Basically, for Mandelbulbs (3d Mandelbrot) with standard trig we aren't going to be able to maintain symmetry over (2n+1) * the angle as we can with 2d Mandelbrots, so the idea is to write non-standard trig functions (or perhaps algebraic formulas) for the various z^n. I'll be back later with more thoughts on this... But first, before thoughts on "non-standard trig", what about a programmer's take on "standard trig"? (it works) r2=(sx^2+sy^2+sz^2)^(n/2);
theta=atan2(sx+flip(sqrt(sqr(sy)+sqr(sz))));
phi=atan2(abs(sy)+flip(abs(sz))); or phi=atan2 (sy+flip(sz)); // makes nice images as well... I suppose it's the absolute value of the pixel components?
nx=r2*cos(theta*v); ny=r2*sin(theta*v)*cos(phi*v); nz=r2*sin(theta*v)*sin(phi*v);
if (juliaMode) { sx=nx+cr; sy=ny+ci; sz=nz+cj; } else { sx=nx+(pixelr); sy=ny+abs(pixeli); // absolute value is your friend sz=nz+abs(pixelj); // } z=quaternion(sx,sy,sz,0); bail=sx^2+sy^2+sz^2;
Interesting patterns produced, but still.. hrmm. The z^2 now has interesting twists appearing in elephant valley: Not to mention seahorse valley: or some other z^2, like this zoom of the top (looking down the z axis, I zoomed to one side a bit) the above, zoomed a bit more, towards the top side of the x-axis: and this random zoom into the front part of the fractal (the - x axis side is what I consider the "front") or a better, more seahorse valley like location: And a quick shot of a bit of z^3 weirdness:
|
|
« Last Edit: June 24, 2010, 07:15:16 AM by M Benesi »
|
Logged
|
|
|
|
M Benesi
|
|
« Reply #25 on: June 24, 2010, 06:57:07 AM » |
|
I extended it up to 4d. Works like a charm. Except when you don't take the absolute value of the y component (in angular calculations) it doesn't look as pleasing (at least for the 4d Snakehead fountain area). Haven't implemented absolute values into the following complex triplex codes... but they are faster, and probably "correct". Here is the updated complex triplex (faster) 3d code, followed by the 4d code. 3d code: r1=sqrt(sqr(sy)+sqr(sz)); r3=r1^(-n); // take it to the -n so you don't have to divide by r3, as it can equal zero for the first iteration
victor=complex(sx,r1); bravo=complex(sy,sz); victor=victor^n; // for higher powers, set up a script if n= integer powers for each n so bravo=bravo^n; // for n=4 bravo^4 = sqr(sqr(bravo)) || for n=6 bravo^6 = sqr(bravo)*sqr(sqr(bravo)) nx=real(victor); ny=imag(victor)*real(bravo)*r3; // since r3=r1^-n you don't have to divide here.. good if r3=0 nz=imag(victor)*imag(bravo)*r3;
if (juliaMode) { sx=nx+cr; sy=ny+ci; sz=nz+cj; } else { sx=nx+(pixelr); sy=ny+(pixeli); // take the abs(pixeli) for a more uniform fractal, although the distortion of the even n sz=nz+(pixelj); // z^2,4,6.... is to be expected considering the asymmetry of the 2d set for even n } z=quaternion(sx,sy,sz,0); //this is not part of the calculation, it just feeds information to ChaosPro's orbital color scheme bail=abs(sx)+abs(sy)+abs(sz);
4d code (see comments in 3d code for explanations/improvements that can be made): r1=sqrt(sqr(sy)+sqr(sz)+sqr(sk)); r2=sqrt(sqr(sz)+sqr(sk)); r3=r1^(-n); r4=r2^(-n);
victor=complex(sx,r1); bravo=complex(sy,r2); cramden=complex(sz,sk); victor=victor^n; bravo=bravo^n; cramden=cramden^n; nx=part_r(victor); ny=part_i(victor)*part_r(bravo)*r3; nz=part_i(victor)*part_i(bravo)*r3*part_r(cramden)*r4; nk=part_i(victor)*part_i(bravo)*r3*part_i(cramden)*r4;
if (juliaMode) { sx=nx+cr; sy=ny+ci; sz=nz+cj; sk=nk+ck; } else { sx=nx+(pixelr); sy=ny+abs(pixeli); sz=nz+abs(pixelj); sk=nk+abs(pixelk); } z=quaternion(sx,sy,sz,sk); bail=abs(sx)+abs(sy)+abs(sz)+abs(sk);
|
|
« Last Edit: June 28, 2010, 07:15:50 AM by M Benesi »
|
Logged
|
|
|
|
M Benesi
|
|
« Reply #26 on: June 25, 2010, 08:16:51 AM » |
|
A few images, after a few comments. Basically, I think I might have been thinking about triplex (and complex) numbers a bit backwards: or maybe I didn't really think about them in a direction at all. I've been multiplying cosines and sines by magnitudes, thinking that this took them into the realm of complex (and triplex) numbers. But really, when I wrote the complex triplex formulas (posted above), I started thinking that maybe this way of looking at it is backwards. When you take victor: victor = x + i * sqrt( y^2 + z^2) to the nth power, then take bravo: bravo = y + i * z to the nth power, and grab the components out of them to create new x, y and z values, you don't want to apply the magnitude of the y and z components twice, which you would be doing if you multiplied the components of bravo^n by the imaginary part of victor^n (which already has been effected by the magnitude^n (n times)) without dividing out the magnitude n times. The magnitude has to be divided out once for each time it would be double applied (for the y and z components), which I do in the above formulas. So the whole thing of ending up with a sin and a cosine times the magnitude of all 3 variables is actually the elimination of the 2nd set of magnitudes of y and z when we extend complex numbers to higher powers. Anyways, here is a neat glacial looking z^2 thing I did by taking the 4d formula and setting: sx=nx+sx; sy=ny+pixelr; sz=nz+abs(pixeli); sk=nk+pixelj; for the 4 variables. It ends up being a wickedly complex fractal for odd n z^n (5, 9, 13... are the best). In fact z^9 is unbelievably awesome to zoom into, although the even n z^n are slightly boring... and here is a 3d z^3 I banged out with the complex triplex formula (1200x1200 z res = 3* took 11 minutes 1 second with an animation calculating in the background!), it's simply a phenomenal formula (click here to view bigger) : Here is the quick video... don't know why, but 480p isn't working (probably a bit later it will) on youtube (I can set it to 480p, but it still looks bad).
http://www.youtube.com/v/4htck30jHpE&rel=1&fs=1&hd=1 This new way of looking at complex numbers extended to higher dimensions can be applied to other formulas as well, like my mag vs. xyz fractals, type D2, or any rotation based fractal. I'll do a release of the various fractals later, starting with mag vs. xyz style, modified to have: victor= complex (sx + i * sqrt (sqr (sy) + sqr (sz) ))); bravo= complex (sy + i * (sqrt (sqr (sx) + sqr (sz) ))); cramden= complex (sz + i * (sqrt (sqr (sx) + sqr (sy) )))................ Anyways, the idea doesn't really work that well, at least in the ways that I've applied it. I do think that the Christmas tree fractal formula is the "real deal" for a few reasons. The 2d Mandelbrot sets asymmetry over the +/- x axis for even n (z^2,4,6...) is extended to the 3d set, but it is magnified by the asymmetry of the y-z portion of the formula which results in the very asymmetric even n 3d fractals.
|
|
« Last Edit: June 26, 2010, 10:39:59 PM by M Benesi »
|
Logged
|
|
|
|
|