Logo by mauxuam - 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. March 28, 2024, 11:29:22 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]   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: Distance Estimation for complex function  (Read 1938 times)
0 Members and 1 Guest are viewing this topic.
M Benesi
Fractal Schemer
****
Posts: 1075



WWW
« on: June 15, 2015, 05:55:46 AM »

Is it even possible to do DE on an ABS function type?  

  Say you have a function, you rotate, take the absolute value of something -.5 (in this case), then rotate back.  


x= \frac{\sqrt{2}\,\left( \sqrt{2}\,\left( \left| \frac{\frac{\sqrt{2}\,x}{\sqrt{3}}-\frac{z}{\sqrt{3}}}{\sqrt{2}}+\frac{y}{\sqrt{2}}\right| -0.5\right) +\sqrt{2}\,\left( \left| \frac{\frac{\sqrt{2}\,x}{\sqrt{3}}-\frac{z}{\sqrt{3}}}{\sqrt{2}}-\frac{y}{\sqrt{2}}\right| -0.5\right) \right) }{\sqrt{3}}+\frac{2\,\left( \left| \frac{\sqrt{2}\,z}{\sqrt{3}}+\frac{x}{\sqrt{3}}\right| -0.5\right) }{\sqrt{3}}

y=\sqrt{2}\,\left( \left| \frac{\frac{\sqrt{2}\,x}{\sqrt{3}}-\frac{z}{\sqrt{3}}}{\sqrt{2}}+\frac{y}{\sqrt{2}}\right| -0.5\right) -\sqrt{2}\,\left( \left| \frac{\frac{\sqrt{2}\,x}{\sqrt{3}}-\frac{z}{\sqrt{3}}}{\sqrt{2}}-\frac{y}{\sqrt{2}}\right| -0.5\right)

z=\frac{-\sqrt{2}\,\left( \left| \frac{\frac{\sqrt{2}\,x}{\sqrt{3}}-\frac{z}{\sqrt{3}}}{\sqrt{2}}+\frac{y}{\sqrt{2}}\right| -0.5\right) -\sqrt{2}\,\left( \left| \frac{\frac{\sqrt{2}\,x}{\sqrt{3}}-\frac{z}{\sqrt{3}}}{\sqrt{2}}-\frac{y}{\sqrt{2}}\right| -0.5\right) }{\sqrt{3}}+\frac{{2}^{\frac{3}{2}}\,\left( \left| \frac{\sqrt{2}\,z}{\sqrt{3}}+\frac{x}{\sqrt{3}}\right| -0.5\right) }{\sqrt{3}}

 How would one go about doing DE with |absolute| value reflections, and the like, every freaking iteration!

  This is what I do before I apply a Mandelbulb formula, and I actually have another additional step in between the rotations occasionally, which makes it an even bigger.. bleh.
« Last Edit: June 15, 2015, 06:02:14 AM by M Benesi » Logged

laser blaster
Iterator
*
Posts: 178


« Reply #1 on: June 15, 2015, 07:47:20 AM »

In general, distance estimation can be done for any formula, using this technique: http://iquilezles.org/www/articles/distance/distance.htm
This is essentially just a simple root-finding technique. It's not very robust, though, if your function isn't "well-behaved", you will get overstepping, which you can alleviate by decreasing the fudge factor. Another option would be to resort to a completely general and accurate root-finding method, probably something involving interval arithmetic (this has never really been tried by the fractal community before, as far as I know).

If your formula is close enough to the Mandelbrot formula, then you'll be better off using the classic Mandelbrot/Mandelbulb DE function, de = 0.5*log(r)*r/dr
This function works on a similar principal as Quilez' version, but is specially designed to give accurate results for the 2D Mandelbrot (and seems to give improved results for any 2D or 3D abs variant of it).

The derivative (which is necessary to compute the DE) can be calculated using the same techniques as with the Mandelbulb. The running scalar derivative approach is too inaccurate to give good results for the power 2 3D burning ship (actually, the scalar derivative method gives inaccurate results for all formulas, including the 2D Mandelbrot, but it's not really noticeable for the Mandelbulb), so I suggest using the 4-point delta DE approach.

Even with the 4-point DE, there is still considerable overstepping and noisy/foamy areas, that can be corrected by a lower fudge factor. This is because the DE formula (de = 0.5*log(r)*r/dr[/b]) is only valid for the regular 2D Mandelbrot. This is because DE formula was derived using theorems that only apply to conformal maps, and all 3D Mandelbulb variants, along with all 2D abs variants, are non-conformal formulas.
Logged
M Benesi
Fractal Schemer
****
Posts: 1075



WWW
« Reply #2 on: June 16, 2015, 05:47:54 AM »

  Yeah.  I'm using a Mandelbulb after the above function is completed- and I'm using an additional function that adds more holes:

  The 3d z^2 "Mandelbrot" I'm doing has... lots of space in it, so DE can't overstep.  Now, I can calculate very close to the object, and then put the space inside, but I'm still doing some transformations that aren't easy to follow (if you look at the above math, there are rotations, absolute values, then more rotations- you can leave out the -.5 "seed" value and apply that to the x-axis later).

« Last Edit: June 16, 2015, 05:57:34 AM by M Benesi » Logged

KRAFTWERK
Global Moderator
Fractal Senior
******
Posts: 1439


Virtual Surreality


WWW
« Reply #3 on: June 17, 2015, 04:19:50 PM »

WOW, this looks powerful my friend!  roll eyes

I hope Luca can implement in M3D...
Logged

M Benesi
Fractal Schemer
****
Posts: 1075



WWW
« Reply #4 on: June 19, 2015, 04:11:59 AM »

  Well, unless M3D can do non DE, some math is ahead.

Code:
only do torpart(z) every few iterations.  Great about 2-3 iterations and 4-5 iterations back from final iteration.  I generally start it at iteration 4, and then skip every 2 or 3 iterations. 
I also drop the abspart(z) when I do torpart(z), so that it doesn't get too detailed and fuzzy.

abspart, manpart, abspart, manpart, abspart, manpart, torpart,manpart, abspart, manpart, abspart, manpart, torpart, manpart...


the equations at the top of the thread describe the abspart(z):

abspart(z):

  Rotation from (1,0,0) to (1,1,1);   this is from the x-axis to the magnitude axis
  ABS of x, y, and z;     //  abs + translation+ scale:  x:2|x|-1.2; y:2|y|-1.2; z:2|z|-1.2;
  Translation (x,y, and z ~-.6);   // you can also do the translation after rotating back to x axis
  Scale (x,y,z)*2; //  or scale after the rotation- it's a bit different though.  
  rotation from (1,1,1) to (1,0,0);   //back to the x-axis from the magnitude axis

Mandelbulb part:
manpart(z):

  r1=2.*(x)/sqrt(y^2+z^2);
  x=x^2-y^2-z^2;
temp=r1*(y^2-z^2);   //switch y and z portions to make it more symmetric
y=r1*2.*y*z; //  yz switch is a great trick for z^2 mandelbulb
z=temp;

torpart(z):

Rotate from x-axis to magnitude axis;

x:| sqrt(y^2+z^2) - radius | * scale;   // radius and scale of 1.9 is nice.  
y:| sqrt(x^2+z^2) - radius | * scale;   //  2 is good for both too- it gives nice window holes like the following:
z:| sqrt(x^2+y^2) - radius | * scale;

rotate from mag axis (1,1,1) to (1,0,0) x axis
this is with 1.8 for radius and 2.6 scale of torpart, if it was 1.9 for both (or either???), there wouldn't be a hole:


This video shows that you can rotate individual portions of the fractal (rotate by iteration):
<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>

just torpart video:
<a href="https://www.youtube.com/v/kXa4qdG8a3w&rel=1&fs=1&hd=1" target="_blank">https://www.youtube.com/v/kXa4qdG8a3w&rel=1&fs=1&hd=1</a>
« Last Edit: June 19, 2015, 06:09:41 AM by M Benesi » Logged

Pages: [1]   Go Down
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
Convergent Distance Estimation Programming David Makin 9 7903 Last post November 28, 2008, 10:27:01 PM
by gamma
Convergent Distance Estimation Mathematics David Makin 4 11112 Last post April 08, 2009, 10:07:14 PM
by David Makin
Pseudo Distance Estimation Mandelbulb Implementation JColyer 3 4814 Last post January 09, 2010, 03:30:09 PM
by JColyer
Perpendicular Multibrot with Interior distance estimation Movies Showcase (Rate My Movie) therror 1 1936 Last post November 26, 2016, 03:05:16 AM
by greentexas
Mandelbrot distance estimation problem Help & Support Iariak 7 659 Last post November 19, 2016, 04:14:35 PM
by Iariak

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