Logo by kr0mat1k - Contribute your own Logo!

END OF AN ERA, FRACTALFORUMS.COM IS CONTINUED ON FRACTALFORUMS.ORG

it was a great time but no longer maintainable by c.Kleinhuis contact him for any data retrieval,
thanks and see you perhaps in 10 years again

this forum will stay online for reference
News: Did you know ? you can use LaTex inside Postings on fractalforums.com!
 
*
Welcome, Guest. Please login or register. March 19, 2024, 12:29:42 PM


Login with username, password and session length


The All New FractalForums is now in Public Beta Testing! Visit FractalForums.org and check it out!


Pages: 1 [2]   Go Down
  Print  
Share this topic on DiggShare this topic on FacebookShare this topic on GoogleShare this topic on RedditShare this topic on StumbleUponShare this topic on Twitter
Author Topic: Iterating C  (Read 7806 times)
0 Members and 1 Guest are viewing this topic.
DarkBeam
Global Moderator
Fractal Senior
******
Posts: 2512


Fragments of the fractal -like the tip of it


« Reply #15 on: December 23, 2011, 12:13:52 PM »

Found the right simplification!!! It is;

acos(y/sqrt(r)) = atan2(sqrt(x*x+z*z),y) // used in Inigo Q. bulb
asin(z/sqrt(r)) = 1.5707 - atan2(sqrt(x*x+y*y),z) // used in standard Mandelbulb
Alternative;
asin(z/sqrt(r)) = atan2(z,sqrt(x*x+y*y))


I can do the formula in both flavours, baby. kiss

 rolling on floor laughing

Also found a workaround for arctan() and atan2().

atan(m/n) = atan2(m,n) if n>0. However;
atan(m/n) = atan2(m,abs(n))*sign(n) always
« Last Edit: December 23, 2011, 05:44:20 PM by DarkBeam » Logged

No sweat, guardian of wisdom!
Aexion
Conqueror
*******
Posts: 116


The Fractal Hermit


WWW
« Reply #16 on: December 23, 2011, 01:46:25 PM »

Found the right simplification!!! It is;

acos(y/sqrt(r)) = atan2(sqrt(x*x+z*z),y) // used in Inigo Q. bulb
asin(z/sqrt(r)) = 1.5707 - atan2(sqrt(x*x+y*y),z) // used in standard Mandelbulb


I can do the formula in both flavours, baby. kiss

 rolling on floor laughing

Also found a workaround for arctan() and atan2().

atan(m/n) = atan2(m,n) if n>0. However;
atan(m/n) = atan2(m,abs(n))*sign(n) always



Nice.. here is another experiment: grin
In the Mandelbox, change the C (cx,cy,cz) for:

Code:

rc=sqrt(cx*cx+cy*cy+cz*cz);

iteration..
const float theta1 = atan2(sqrt(cx*cx + cz*cz) , cy)+0.78539816339744830961566084581988;
const float phi1 = atan2(cz,cx)+0.78539816339744830961566084581988;
const float sintheta1=rc * sin(theta1);
cx = sintheta1 * cos(phi1);
cz = sintheta1 * sin(phi1);
cy = rc * cos(theta1);



Unlike the mandelbulb version, this one add an small angle to the C value every iteration, in this case  pi/4..
There's a big difference between rotating C after or before the Mandelbox transformation. One of them gives to the mandelbox a rotated Rubik Cube look..

Logged

Fractals all the way..
Incendia for 3D Fractals
Aural for Musical Fractals
DarkBeam
Global Moderator
Fractal Senior
******
Posts: 2512


Fragments of the fractal -like the tip of it


« Reply #17 on: December 23, 2011, 05:15:07 PM »

Keeping in mind that atan, acos, asin are equivalent of atan2 of modified arguments, and considering more untried variations, I am thinking of a very general customizable Mandelbulb formula.

The formula has this form; (user params are bold)
// --- universal Mandelbulb formula ---
// optional; do here abs(x), abs(y), abs(z) to get Benesi-like formulas ... cheesy

// check for args of th, and load them
// check if atan tweak is ON and modify args accordingly
th := atanmul * power * atan2(args) // Formula with power of angle different than the power of r is not good...
// put tweaks of th here

// check for args of ph, and load them
// check if atan tweak is ON and modify args accordingly
ph := atanmul * zangp * atan2(args)
// put tweaks of ph here
sq_r := sqrt(x*x+y*y+z*z)
r:= sq_r ^ power
x = r*cos(th)*cos(ph) + Cx
y = r*sin(th)*cos(ph) + Cy
z = r*sin(ph)*zmul + Cz



The tweak consists of different choices for the atan2 args.
Let us define the functions
h(a,b) = hypot(a,b) = sqrt(a*a+b*b)
u(a,b) = max(abs(a),abs(b))
d(a,b) = min(abs(a),abs(b))

Tweaks;
a) atan tweak;
The sign of the "signed" (or the first, for variants of type 1) argument is not considered, then atanmul = sgn(argument)
b) xenodream tweak;  (used in the Xenodream variant, after the calculation of atan2() do this correction)
if (angle > 0.5 * M_PI) { angle = M_PI - angle;} else if (angle < -0.5 * M_PI) { ph = -M_PI - angle;}
Args;       
1) x,y // x,z // y,x // y,z // z,x // z,y (normal variables).
2) x, h(y,z) // y, h(x,z) // z, h(x,y) // and the previous args in reversed order. (simulation of arcsin(), arccos() functions).
3) x, u(y,z) // y, u(x,z) // z, u(x,y) // and the previous args in reversed order. (the "cubic distance" instead of the euclidean one).
4) x, d(y,z) // y, d(x,z) // z, d(x,y) // and the previous args in reversed order. (alternate "cubic distance").

This should cover every possible Mandelbulb variation EXCEPT for rotations OR abs(x) thingmajigs.  wink (total of 6x4x4 variants for EACH angle considered, WITHOUT considering 4 dimensional bulbs.)
« Last Edit: December 23, 2011, 07:21:26 PM by DarkBeam » Logged

No sweat, guardian of wisdom!
DarkBeam
Global Moderator
Fractal Senior
******
Posts: 2512


Fragments of the fractal -like the tip of it


« Reply #18 on: December 23, 2011, 10:44:03 PM »

I have done the formula but it needs more refinement, see tomorrow smiley
From that formula it's straightforward the Aexion C mangling smiley
Logged

No sweat, guardian of wisdom!
Jesse
Download Section
Fractal Schemer
*
Posts: 1013


« Reply #19 on: December 23, 2011, 11:30:59 PM »

Made some testings, but the possibilities are big, so this needs further exploration.

I guess the first image shows more or less the same as your first result with rotated C, only that you stopped at max iterations and my image was at a certain distance with more iterations at the spikes.  Not really sure but this is one i had those spikes, it was without the negation of the atan2's.

The second (attached) image was an experiment of doing the C rotation based on the difference of the vectors Z and C.
Maybe i did the rotation on C also with a different coordinate system orientation.

A kind of interaction between those vectors seems a not that bad idea to me...?





* AexionRotateCmod2 p8.jpg (188.44 KB, 600x600 - viewed 546 times.)
« Last Edit: December 23, 2011, 11:34:16 PM by Jesse » Logged
Aexion
Conqueror
*******
Posts: 116


The Fractal Hermit


WWW
« Reply #20 on: December 24, 2011, 12:40:34 AM »

Made some testings, but the possibilities are big, so this needs further exploration.

I guess the first image shows more or less the same as your first result with rotated C, only that you stopped at max iterations and my image was at a certain distance with more iterations at the spikes.  Not really sure but this is one i had those spikes, it was without the negation of the atan2's.

The second (attached) image was an experiment of doing the C rotation based on the difference of the vectors Z and C.
Maybe i did the rotation on C also with a different coordinate system orientation.

A kind of interaction between those vectors seems a not that bad idea to me...?

Beautiful renders Jesse, and you're right, this needs more exploration! smiley
And yes, in my first image, I didn't negated the atan2.. It was in the second image on where I negated it (as an experiment suggested by eiffie)

Some sections of the first image reminds me the decoration of the Mayan Stela's, while the second looks like the Brain Coral:
http://en.wikipedia.org/wiki/Brain_coral


ps. Do not mention that the first set looks like the Mayan Calendar in many places, because finding such calendar in a fractal, near 2012 will cause a large amount of end of the world news.. grin
« Last Edit: December 24, 2011, 01:33:51 AM by Aexion » Logged

Fractals all the way..
Incendia for 3D Fractals
Aural for Musical Fractals
Jesse
Download Section
Fractal Schemer
*
Posts: 1013


« Reply #21 on: December 24, 2011, 03:22:08 PM »


Beautiful renders Jesse, and you're right, this needs more exploration! smiley
And yes, in my first image, I didn't negated the atan2.. It was in the second image on where I negated it (as an experiment suggested by eiffie)

Some sections of the first image reminds me the decoration of the Mayan Stela's, while the second looks like the Brain Coral:
http://en.wikipedia.org/wiki/Brain_coral

The brain coral reminds me of an selforganizating cell automata (dunno if this is a correct name for it) that produces same structures, have to see if i can find the program.

Quote
ps. Do not mention that the first set looks like the Mayan Calendar in many places, because finding such calendar in a fractal, near 2012 will cause a large amount of end of the world news.. grin

No prob, the Mayan Calendar mythos can be easily falsificated by some bits of information.  wink

Merry christmas, attached a test with the amount of C rotation mutliplied by euclidian distance of the vecs...


* RotateC christmas.jpg (183.44 KB, 800x600 - viewed 525 times.)
Logged
Aexion
Conqueror
*******
Posts: 116


The Fractal Hermit


WWW
« Reply #22 on: December 25, 2011, 11:38:52 AM »


Merry christmas, attached a test with the amount of C rotation mutliplied by euclidian distance of the vecs...


Merry Christmas for you too Jesse!! Great Render!! The shapes and the lights are incredible! I like it.
One interesting feature hat I have noted, is the fact that if you run C on conditionals, the fractal doesn't show discontinuity, but interesting structures appears..
For example:
Code:
const float theta1 = atan2(sqrt(cx*cx + cz*cz) , cy)*8;
const float phi1 =(x>0)?atan2(cz,cx)*8:-atan2(cz,cx)*8;

Try it.. smiley

« Last Edit: December 25, 2011, 11:42:12 AM by Aexion » Logged

Fractals all the way..
Incendia for 3D Fractals
Aural for Musical Fractals
DarkBeam
Global Moderator
Fractal Senior
******
Posts: 2512


Fragments of the fractal -like the tip of it


« Reply #23 on: December 25, 2011, 12:07:10 PM »

Ramiro this concept is similar to XenoDream's angular fold;

            double rp = pow(r, p);
            double th = atan2(z.y, z.x);
            double ph = acos(z.z / r);
            if (ph > 0.5 * M_PI)
            {
               ph = M_PI - ph;
            }
            else if (ph < -0.5 * M_PI)
            {
               ph = -M_PI - ph;
            }

            z.x = rp * cos(th * p) * sin(ph * p);
            z.y = rp * sin(th * p) * sin(ph * p);
            z.z = rp * cos(ph * p);
            z = z + constant;

            r = z.Length();

 grin
Logged

No sweat, guardian of wisdom!
DarkBeam
Global Moderator
Fractal Senior
******
Posts: 2512


Fragments of the fractal -like the tip of it


« Reply #24 on: December 25, 2011, 01:25:49 PM »

Woohoo!!!! Esto es el RamiroBulb!!!  grin grin grin


* ramiro.jpg (36.69 KB, 623x346 - viewed 559 times.)
Logged

No sweat, guardian of wisdom!
Aexion
Conqueror
*******
Posts: 116


The Fractal Hermit


WWW
« Reply #25 on: December 26, 2011, 02:30:56 AM »

Ramiro this concept is similar to XenoDream's angular fold;

            double rp = pow(r, p);
            double th = atan2(z.y, z.x);
            double ph = acos(z.z / r);
            if (ph > 0.5 * M_PI)
            {
               ph = M_PI - ph;
            }
            else if (ph < -0.5 * M_PI)
            {
               ph = -M_PI - ph;
            }

            z.x = rp * cos(th * p) * sin(ph * p);
            z.y = rp * sin(th * p) * sin(ph * p);
            z.z = rp * cos(ph * p);
            z = z + constant;

            r = z.Length();

 grin


Actually the formulas was for a dynamic rotation of  'C' while iterating, rather for a fixed 'C' iteration...
Here's the function:
Code:
bool MBulbCr(float x, float y, float z,int miter){
int Counter;
float ctx=x;
float cty=y;
float ctz=z;
const float rc = sqrt(ctx*ctx + cty*cty + ctz*ctz);
  for(Counter=0;Counter<miter;Counter++){
const float r = sqrt(x*x + y*y + z*z);
const float theta = atan2(sqrt(x*x + z*z) , y)*8;
const float phi = atan2(z,x)*8;
const float r2=r*r*r*r;
const float r1=r2*r2;
const float sintheta=r1 * cos(theta);
x = sintheta * cos(phi)+ctx;
y = sintheta * sin(phi)+cty;
z = r1 * sin(theta)+ctz;
const float theta1 = atan2(sqrt(ctx*ctx + ctz*ctz) , cty)*8;
const float phi1 =(x>0)?atan2(ctz,ctx)*8:-atan2(ctz,ctx)*8;
const float sintheta1=rc * cos(theta1);
ctx = sintheta1 * cos(phi1);
cty = sintheta1 * sin(phi1);
ctz = rc * sin(theta1);
if (r>4) break;
}
if(Counter<miter)return true;else return false;
}

If you iterate the system with this conditional, it will looks like:



The field is open for many other combinations of rules (IFS?)..
Good luck!
 
« Last Edit: December 26, 2011, 02:50:38 AM by Aexion » Logged

Fractals all the way..
Incendia for 3D Fractals
Aural for Musical Fractals
DarkBeam
Global Moderator
Fractal Senior
******
Posts: 2512


Fragments of the fractal -like the tip of it


« Reply #26 on: December 26, 2011, 07:38:46 PM »

Ramiro; your formula, a lot generalized, has been called _GenCWarp and you have been credited A Beer Cup

No time to do test renders now, it may be surely overwhelming btw scared white ugly head batting

Hey a first render wink

http://www.fractalforums.com/index.php?action=gallery;sa=view;id=9684
« Last Edit: December 27, 2011, 05:02:56 PM by DarkBeam » Logged

No sweat, guardian of wisdom!
willclark218
Forums Freshman
**
Posts: 11


« Reply #27 on: February 09, 2013, 07:43:10 PM »

your English is damn good ... better than most Americans.. embarrass ... greta post
Logged
Pages: 1 [2]   Go Down
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
Iterating Random Powers Mandelbrot & Julia Set Alef 5 2849 Last post November 19, 2013, 05:28:45 PM
by Rychveldir

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM
Page created in 0.258 seconds with 29 queries. (Pretty URLs adds 0.007s, 2q)