Title: THE formula for Mandelbulb? Post by: ZsquaredplusC on November 21, 2009, 07:10:33 AM Hello all,
Can we now clarify the formulas used to create the Mandelbulb? I have been using the formulas from Christian here http://www.fractalforums.com/3d-fractal-generation/true-3d-mandlebrot-type-fractal/msg8763/#msg8763 They seem to work OK and I am getting some results that show the brocolli etc (how do I insert an image inline to a posting here?) But then on Daniel's page here http://www.skytopia.com/project/fractal/2mandelbulb.html#iter they are different and if I use those versions, specifically... r = sqrt(x*x + y*y + z*z ) theta = atan2(sqrt(x*x + y*y) , z) phi = atan2(y,x) ...I get a blank image. Can we have a posting that gives the final Mandelbulb formulas? I am sure this will help people like me who after going through a printout of 163 pages :ugly: of printouts of the original thread can have a definitive "this is what you need to use" reference. Also the non trig formulas here http://www.fractalforums.com/3d-fractal-generation/true-3d-mandlebrot-type-fractal/msg8680/#msg8680 They are only for the z^exponent parts (as in the z^4 part of z^4+c) right? If I use those speedups then I still need to do the trig distance estimation calcs? Thanks for any tips. I am sure if there was a definitive reference it would help others like me who are not up with the mathematics invlolved. Title: Re: THE formula for Mandelbulb? Post by: s31415 on November 21, 2009, 04:48:01 PM I think that the conceptual way to put it is that to "raise a 3d vector to a power p", you:
- Switch to spherical coordinates, with an azimut running between 0 and 2pi and an elevation running between -pi/2 and pi/2 so that the equator lies at zero elevation. - Raise the radius to power p and multiply both the azimut and the elevation by p. If the elevation gets out of the [-pi/2, pi/2] range, you can either add pi to phi or leave it as it is. Most people leave it as it is. See this post by Jos Leys for a comparison of the two methods: http://www.fractalforums.com/3d-fractal-generation/true-3d-mandlebrot-type-fractal/msg8743/#msg8743 - Switch back to cartsian coordinates. Title: Re: THE formula for Mandelbulb? Post by: s31415 on November 21, 2009, 04:49:00 PM Oups, sorry, I said "add pi to phi", in my mind, phi is the azimut...
Title: Re: THE formula for Mandelbulb? Post by: fractalrebel on November 21, 2009, 07:30:12 PM I am sure this will help people like me who after going through a printout of 163 pages :ugly: of printouts of the original thread can have a definitive "this is what you need to use" reference. I also haven't gone through the 163 pages. Here is what I do (in UltraFractal 5): Title: Re: THE formula for Mandelbulb? Post by: David Makin on November 21, 2009, 07:52:02 PM I think the best reference for this so far is the one already quoted, i.e. Paul Nylander's definition which also gives some of the non-trig versions:
http://www.fractalforums.com/3d-fractal-generation/true-3d-mandlebrot-type-fractal/msg8680/#msg8680 (http://www.fractalforums.com/3d-fractal-generation/true-3d-mandlebrot-type-fractal/msg8680/#msg8680) In my case my current formula for UF uses that method except the original version that Paul refers to where the sign of the final "z" term is reversed - I'm going to add the option to use the +sine version as an alternative. Another way of writing the (positive sine) same formula in Ultra Fractal is: ztemp = ((r=cabs(zri)) + flip(zj))^@mpwr zri = real(ztemp)*(zri/r)^@mpwr + cri zj = imag(ztemp) + cj Where ztemp, zri and cri are complex and r, zj, cj and @mpwr are real though @mpwr could be complex. Historically speaking I believe the negative sine version was preferred as it has less "whipped cream" on the z^2+c version :) But I agree with Paul in his comments about the positive sine version being more "correct" mathematically speaking. Obviously in the above real/complex version to get fractalrebel's method just negate imag(ztemp) in the zj term. Title: Re: THE formula for Mandelbulb? Post by: ineri on November 21, 2009, 09:32:18 PM I have just a simple question, based on the geometric interpretation, i.e., the rotations, phi is periodic, but theta is not, so has anyone tried to see what happens if you respect this. If you move theta out of its domain you should flip phi as you are actually now on the other side of the sphere. You are basically working with a double covering of the sphere by not doing this. //Ingemar Eriksson Title: Re: THE formula for Mandelbulb? Post by: s31415 on November 22, 2009, 11:33:21 PM See this post by Jos Leys: http://www.fractalforums.com/3d-fractal-generation/true-3d-mandlebrot-type-fractal/msg8743/#msg8743 |