Logo by reallybigname - 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: Check out the originating "3d Mandelbulb" thread here
 
*
Welcome, Guest. Please login or register. January 09, 2026, 01:54:53 AM


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 3 ... 7   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: Benesi "pinetree" (fold+bulb)  (Read 7179 times)
0 Members and 1 Guest are viewing this topic.
M Benesi
Fractal Schemer
****
Posts: 1075



WWW
« on: July 26, 2015, 01:58:55 AM »

  I was thinking about attempting to program a couple of non-DE formulas for the following 2 types of closely related fractals:



and this one:



 For the top image type, one alternates between formula 1 (below) and the pine tree Mandelbulb formula.  For the second image type, every few iterations one substitutes formula 2 (instead of formula 1) in between the pine tree Mandelbulb formulas.  Initialize the formula with pixel values, and then only add in the x pixel component each iteration, otherwise it isn't as pretty, although it still is the best z^2 type out there.

  Formula 1:
Code:
temp_x=start_x*sqrt(2/3)-start_z*sqrt(1/3);
new_z=start_x*sqrt(1/3) + start_z*sqrt(2/3);  
new_x=temp_x*sqrt(1/2)-start_y*sqrt(1/2);          
new_y=temp_x*sqrt(1/2)+start_y*sqrt(1/2);

new_x=abs(new_x);  
new_y=abs(new_y);  
new_z=abs(new_z);  

temp_x=new_x*sqrt(1/2)+new_y*sqrt(1/2);
new_y=-new_x*sqrt(1/2)+new_y*sqrt(1/2);
new_x=temp_x*sqrt(2/3)+new_z*sqrt(1/3);
new_z=-temp_x*sqrt(1/3)+new_z*sqrt(2/3);

new_x=scale*new_x-offset;  //scale =2    offset=2      
new_y=scale*new_y;
new_z=scale*new_z;


Formula 2.  Do it every few iterations, switching with the above formula.  Or by itself.
Code:
temp_x=start_x*sqrt(2/3)-start_z*sqrt(1/3);
temp_z=start_x*sqrt(1/3) + start_z*sqrt(2/3);  
new_x=temp_x*sqrt(1/2)-start_y*sqrt(1/2);          
temp_y=temp_x*sqrt(1/2)+start_y*sqrt(1/2);
temp_x=new_x;

new_x=abs(sqrt(temp_y^2+temp_z^2)-offset2)*scale2 ;  // scale2 ~1.9    mess around with these...
new_y=abs(sqrt(temp_x^2+temp_z^2)-offset2)*scale2 ;  // offset2 ~1.9    
new_z=abs(sqrt(temp_x^2+temp_y^2)-offset2)*scale2 ;

temp_x=new_x*sqrt(1/2)+new_y*sqrt(1/2);
new_y=-new_x*sqrt(1/2)+new_y*sqrt(1/2);
new_x=temp_x*sqrt(2/3)+new_z*sqrt(1/3);
new_z=-temp_x*sqrt(1/3)+new_z*sqrt(2/3);
« Last Edit: October 13, 2015, 11:52:59 AM by DarkBeam, Reason: Renamed for a better forum usability! Sorry » Logged

DarkBeam
Global Moderator
Fractal Senior
******
Posts: 2512


Fragments of the fractal -like the tip of it


« Reply #1 on: September 27, 2015, 07:36:10 PM »

Hello Matthew glad to cya around again smiley
You just need the bare formula in mb3d the proggie does the rest all alone.
Btw it takes a bit of assembly to code it properly. No time I fear.
Logged

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


Fragments of the fractal -like the tip of it


« Reply #2 on: October 02, 2015, 05:10:34 PM »

By the way please provide a name - Benesi4? Does it exist wink
Also are you sure the formula is ok? ... it contains sqrt of something but usually power 2 formulas have plain x2+y2 no sqrt.
I cannot start so I wait for notice snore
« Last Edit: October 02, 2015, 06:47:31 PM by DarkBeam » Logged

No sweat, guardian of wisdom!
M Benesi
Fractal Schemer
****
Posts: 1075



WWW
« Reply #3 on: October 09, 2015, 05:12:32 AM »

smiley  Glad you're still bouncing around too.  Found an assembler that might work here: http://flatassembler.net/  so maybe I'll try it out.  If you've got a bit of pre-made code to play with???  cheesy


  Names?  I thought the top one (blue and white) looked a bit like it had lots of little peyote cacti growing out of it...  but it's based off of another old formula.  The other one was me playing around with a torus formula, and going off on a tangent that ended up being sort of nice.  

  I honestly can't think of names...  if you like:

  Peyote Button for the blue and white one?
  Maybe Honeycomb for this one:  



  Although I do like having formulas named after me.   shocked  So Benesi4 and Benesi5 would be cool too.  cheesy  

  The square roots are for a rotation from the x-axis to the "mag" axis, and are essential to the formula.  The formulas are not very interesting by themselves- they work well with the pine tree version of the Mandelbulb formula.

  You switch back and forth between them and the pine tree Mandelbulb formula  (1 of them, Mandelbulb, 1 of them, Mandelbulb.....).

 Posting the code for the pine tree Mandelbulb below, so you know which Mandelbulb formula works best.

  The coolest thing about this formula is that you can rotate individual sections of it:

<a href="https://www.youtube.com/v/SXx36wiDpN0&rel=1&fs=1&hd=1" target="_blank">https://www.youtube.com/v/SXx36wiDpN0&rel=1&fs=1&hd=1</a>

Code:
//  z^2 pine tree Mandelbulb, for speed, just elementary math, no trig functions

x_temp=start_x^2;
y_temp=start_y^2;
z_temp=start_z^2;

new_x= x_temp - y_temp - z_temp;

temp=2.*(start_x)/sqrt(temp_y+temp_z);

new_z=temp*(temp_y-temp_z);            //y and z variables are switched to add symmetry
new_y=temp*2.*start_y*start_z;




//regular formula with trig stuff, different variable names,
// don't want to change the variable names since you probably have a version of this in M3D:

r2=(sx*sx+sy*sy+sz*sz)^(n/2);  
r1=sqrt(sy*sy+sz*sz);     //r1 is used to calculate theta

theta=atan2(r1+flip(sx))*n;   //flip just multiplies by i
phi=atan2(sz+flip(sy))*n;     // this is regular atan2...

new_x=r2*cos(theta);
r2=r2*sin(theta);
new_y=r2*cos(phi);
new_z=r2*sin(phi);


  A couple images of various mixtures of the formulas are here:

  https://picasaweb.google.com/103496528720991269557/NewFractalType
« Last Edit: October 09, 2015, 05:23:30 AM by M Benesi » Logged

DarkBeam
Global Moderator
Fractal Senior
******
Posts: 2512


Fragments of the fractal -like the tip of it


« Reply #4 on: October 09, 2015, 01:03:21 PM »

Yeah okay Matt. smiley I will be more clear
Your z2 pine mandelbulb looks okay. Some coordinate look squared because you do X2 - Y2 - Z2

The previous formulas you wrote are not ok in my eyes... (and they are radically different)
Because a Mandelbrot squaring must contain ... a squaring smiley so if you take sqrt of x2 it "returns to x" and it will not work - it should give a never escaping fractal. Different would be taking sqrt of x^4... or multiplying two of them.

Saying this because starting to code is frustrating already but a potentially wrong formula stops me sad

Or... maybe I just mistaken?... the formulas of posts 1 and 2 are just modifiers TO BE USED IN CONJUNCTION with the pine tree which is exactly the last formula you posted A Beer Cup
In this last case all is ok... wink

last thing... is "pine tree" a normal Pow2 bulb?...
Just to know if I have to rewrite it from scratch or no?... cool
« Last Edit: October 09, 2015, 03:38:20 PM by DarkBeam » Logged

No sweat, guardian of wisdom!
M Benesi
Fractal Schemer
****
Posts: 1075



WWW
« Reply #5 on: October 09, 2015, 06:45:47 PM »

Saying this because starting to code is frustrating already but a potentially wrong formula stops me sad
 Let me see if I can snip some code out of my experimental code database (which is large) and post a small, working, cleaned/organized ChaosPro version here after I finish this message.

Or... maybe I just mistaken?... the formulas of posts 1 and 2 are just modifiers TO BE USED IN CONJUNCTION with the pine tree which is exactly the last formula you posted A Beer Cup
In this last case all is ok... wink
 Yes, in my experience, they are most interesting combined with other formulas.  A Beer Cup   You can do stuff with the plain old modifiers, I just like them the most mixed with the pine tree.  

  The 2nd formula (by itself) makes the following (I don't have an image of the first formula, don't think it was very interesting stand alone?? can't recall):

 

last thing... is "pine tree" a normal Pow2 bulb?...
Just to know if I have to rewrite it from scratch or no?... cool
 It's slightly different then the "normal" version on wikipedia, but it might be the version you use.  If you do have to rewrite the formula, you might be able to take the old formula and just switch variables instead of writing from scratch.


  Ehh.. best explanation:  The main difference is the "normal" formula rotates [x vs. y] and [(x and y) vs. z] and the pine tree version rotates [(x vs. (y and z)] and [y vs. z].

"normal":

r=\sqrt{x^2+y^2+z^2}

\phi=\arctan(y/x)=\arg (x+yi)

\theta=\arctan(\sqrt{x^2+y^2}/z)=\arccos(z/r)

... rest of formula...  (multiply angles by n, take r^n.....)...  This one (for z^2) gives you new_x = x^2+y^2-z^2, new_y = 2(x^2-y^2)*z, new_z= 4xyz

pine tree:

r=\sqrt{x^2+y^2+z^2}

\phi=\arctan(z/y)=\arg (y+zi)

\theta=\arctan(\sqrt{y^2+z^2}/x)=\arccos(x/r)

...rest of formula.   new_x =  x^2 - y^2 -z^2 instead of x^2+y^2-z^2, new_y = whatever I posted earlier, etc..


  I need to eat breakfast, and then clean up that ChaosPro code and post it here so you can see how the formula works (and we can make sure I translated it correctly!!$!$).

  Matt
« Last Edit: October 09, 2015, 07:00:44 PM by M Benesi » Logged

DarkBeam
Global Moderator
Fractal Senior
******
Posts: 2512


Fragments of the fractal -like the tip of it


« Reply #6 on: October 09, 2015, 07:16:27 PM »

Another thing I don't fully get is NY=2TYZ
When NZ=T(TY-TZ)... Z is multiplied by a 2 and it is ok.
But! T itself is already T=2X(TY+TZ)^-0.5
So Y gets multiplied by a factor of 4.
So again I reccomend you to look carefully... those anomalies may cause unwanted stretch. smiley
Probably a math little mistake and also could look good as is nevertheless!!!
Logged

No sweat, guardian of wisdom!
M Benesi
Fractal Schemer
****
Posts: 1075



WWW
« Reply #7 on: October 09, 2015, 08:55:23 PM »

 Cleaned up some ChaosPro code for you to look at.  My code was horribly messy!  Took a few hours to clean up, and (update at 1:05pm GMT/UTC -8, a little bit more to correct one little mistake!). 
  
  To try the CP versions, take the ".txt" file extension off of these to use them with ChaosPro.  Put them in your CP formula directory (well, except for the fractal formula without a file extension- just open it in CP).

  "for luca" is the fractal parameters to load
  "Benesi Coloring.ccl" is the coloring formula I used for that fractal (looks better than other coloring schemes in CP, so I'd use it)
  "Clean ANSI edited.cfm" contains the formula, and an extra one

* Benesi Coloring.ccl.txt (13.58 KB - downloaded 43 times.)
* Clean ANSI edited.cfm.txt (15.69 KB - downloaded 50 times.)
* for luca.txt (3.02 KB - downloaded 45 times.)
« Last Edit: October 09, 2015, 10:06:31 PM by M Benesi » Logged

M Benesi
Fractal Schemer
****
Posts: 1075



WWW
« Reply #8 on: October 09, 2015, 09:41:04 PM »

OHHH!  You were talking about the normal Mandelbulb formula.  Let me look at that, and edit this. Gimme a few minutes.

Another thing I don't fully get is NY=2TYZ
When NZ=T(TY-TZ)... Z is multiplied by a 2 and it is ok.
But! T itself is already T=2X(TY+TZ)^-0.5
So Y gets multiplied by a factor of 4.
So again I reccomend you to look carefully... those anomalies may cause unwanted stretch. smiley
Probably a math little mistake and also could look good as is nevertheless!!!

PINE TREE:

   \left [x + i \sqrt{y^2+z^2} \right ]^2 = \ x^2 - y^2 - z^2 + \ i 2 x \sqrt{y^2+z^2}

   new_x is just the real part: x^2-y^2-z^2

       temp is     \frac {\ i 2 x \sqrt{y^2+z^2}}{y^2+z^2} = i \frac {2x}{\sqrt{y^2+z^2}}

  (we divide out the magnitude x^2+y^2, which we get when we square (y+ iz))
  since:
(y+iz)^2 = y^2-z^2 + i 2yz


      new \ z =temp (y^2-z^2) = \ \frac{2x (y^2-z^2)}{\sqrt{y^2+z^2}}        
      new \ y =temp (2yz) = \ \frac{2x *2yz}{\sqrt{y^2+z^2}}= \ \frac{4xyz}{\sqrt{y^2+z^2}}        
      new_z=temp*(y^2-z^2);            
      new_y=temp*2*y*z;   

  We've already divided out the magnitude of (y+iz)^2 in the "temp" part.  

NORMAL:   edited: the following was wrong.  cheesy    whooops...


   \left [\sqrt{x^2+y^2} + iz \right ]^2 = \ x^2 + y^2 - z^2 + \ i 2 \sqrt{x^2+y^2} z

   new_z is 2 \sqrt{x^2+y^2} z     ZZZZZZZZZZZZZZZZZZ

   temp \frac {x^2+y^2-z^2}{\sqrt{x^2+y^2}}

(x+iy)^2 = x^2-y^2 + i 2xy

      new \ x =temp (x^2-y^2) = \ \frac {(x^2-y^2)(x^2+y^2-z^2)}{\sqrt{x^2+y^2}}        
      new \ y =temp (2xy) = \ \frac {2xy (x^2+y^2-z^2)}{\sqrt{x^2+y^2}}        
      

Here is the fractal from the above code... so if the code works and the math doesn't, something is going on:



« Last Edit: October 23, 2015, 08:00:09 PM by M Benesi » Logged

DarkBeam
Global Moderator
Fractal Senior
******
Posts: 2512


Fragments of the fractal -like the tip of it


« Reply #9 on: October 09, 2015, 11:11:05 PM »

Perfect wink it is a totally different concept and formula from the classic Mandelbulb squaring.

You find the original formulas here http://www.fractalforums.com/index.php?topic=742.msg7711#msg7711

No "4" pops in I correctly remembered cheesy

Will probably try to look tomorrow in those files
THANKS SO MUCH MATTHEW smiley
Logged

No sweat, guardian of wisdom!
mclarekin
Fractal Senior
******
Posts: 1739



« Reply #10 on: October 10, 2015, 03:21:49 AM »

Hi folks,

My trigonometry knowledge is in the far distance past (not like you guys)  so I just ignorantly made these changes, is this a pine tree mandelbulb? smiley smiley smiley

Cheers

Code:
      aux.r = z.Length();
                double th0 = asin(z.x / aux.r) + mandelbulbPT.mandelbulbBetaAngleOffset;    // was z.z/aux.r
                double ph0 = atan2(z.z, z.y) + mandelbulbPT.mandelbulbAlphaAngleOffset;     // was zy, z.x
                double rp = pow(aux.r, mandelbulbPT.mandelbulbPower - 1.0);
                double th = th0 * mandelbulbPT.mandelbulbPower;
                double ph = ph0 * mandelbulbPT.mandelbulbPower;
                double cth = cos(th);
                aux.r_dz = rp * aux.r_dz * mandelbulbPT.mandelbulbPower + 1.0;
                rp *= aux.r;
                z = CVector3(cth * cos(ph), cth * sin(ph), sin(th)) * rp;


* MB6 pta1 7.jpg (117.89 KB, 800x600 - viewed 84 times.)
Logged
M Benesi
Fractal Schemer
****
Posts: 1075



WWW
« Reply #11 on: October 10, 2015, 05:10:50 AM »

Hey Mclarekin, set it to power 2 to be sure (I'll recognize it), but the math looks about right. 
Logged

mclarekin
Fractal Senior
******
Posts: 1739



« Reply #12 on: October 10, 2015, 08:29:03 AM »

Thanks, how about this pwr 2 image?

BTW, Wow and weird., it gets bigger with pwr 2!



* MB6 pta4 800.jpg (150.82 KB, 800x742 - viewed 82 times.)
Logged
mclarekin
Fractal Senior
******
Posts: 1739



« Reply #13 on: October 10, 2015, 10:03:08 AM »

This bit of code  is fun, grin,  I've now got it in a loop following  a standard mandebulb trying out the different powers combinations.  smiley smiley smiley

This fractal forums is the best place to learn, thanks you guys.

Logged
DarkBeam
Global Moderator
Fractal Senior
******
Posts: 2512


Fragments of the fractal -like the tip of it


« Reply #14 on: October 10, 2015, 10:04:50 AM »

Hello there mclarekin wink - why it is asin() instead of acos() like Matthew said? Just curious to see another render wink

Ah... note that atan and atan2 are NEVER the same thing... so try them both A Beer Cup
Logged

No sweat, guardian of wisdom!
Pages: [1] 2 3 ... 7   Go Down
  Print  
 
Jump to:  


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.201 seconds with 24 queries. (Pretty URLs adds 0.009s, 2q)