Welcome to Fractal Forums

Fractal Math, Chaos Theory & Research => Theory => Topic started by: Calcyman on January 04, 2010, 08:34:43 PM




Title: Ideal 3D mandelbrot?
Post by: Calcyman on January 04, 2010, 08:34:43 PM
The classic 3D Mandelbulb has the equation:

(http://latex.codecogs.com/gif.latex?q_{n+1}=q_0+{q_n}^{8})

where q denotes the triplex variable, in the same way that z is used for complex numbers.

As you are already aware, choosing a low order for the polynomial results in a 'whipped cream' effect, whereas a very high value results in an almost spherical fractal. Effectively, deciding on an exponent is a compromise.

A way forward is to combine multiple powers of q. For example, the Order 8 Mandelbulb and Order 12 Mandelbulb could be combined as follows:

(http://latex.codecogs.com/gif.latex?q_{n+1}=q_0+{q_n}^{8}+{q_n}^{12})

To achieve infinite detail, an infinite number of Mandelbulbs should be combined. However, this has the disadvantage that it takes an infinite amount of time to calculate. Moreover, the series could diverge as more terms are added, so the result is not well-defined.


Fortunately, I have developed a solution: to make successive powers of q increasingly negligable. An easy way to do this is to use the factorial function:


(http://latex.codecogs.com/gif.latex?q_{n+1}=q_0+{q_n}^{8}-\frac{1}{2!}{q_n}^{10}+\frac{1}{4!}{q_n}^{12}-\frac{1}{6!}{q_n}^{14}+\frac{1}{8!}{q_n}^{16}+\cdots)

(http://latex.codecogs.com/gif.latex?=q_0+{q_n}^{8}-\frac{1}{2}{q_n}^{10}+\frac{1}{24}{q_n}^{12}-\frac{1}{720}{q_n}^{14}+\frac{1}{40320}{q_n}^{16}+\cdots)

If you haven't already noticed, this is equivalent to the Maclaurin expansion for the expression q^8 cos q. In other words, this infinite series has a fundamental mathematical basis, and is thus only slightly more complicated than the existing 'polynomial' Mandelbulbs.

I do not have sufficient tools to render this fractal, so would be very grateful to see an image of it. Only the first few terms of the infinite series need to be considered, since they rapidly decrease in size: as you can see, the term in q^16 is divided by 40320, and further terms will have minimal effect.

This might be the closest thing to the elusive 'True 3D Mandelbrot'. It has bilateral symmetry, same as the 2D Mandelbrot, which is rather reassuring.


Title: Re: Ideal 3D mandelbrot?
Post by: kram1032 on January 04, 2010, 11:49:08 PM
did you actually try out to just plot simple real graphs of that?

Fractals tend to amplify any accuracy problems (-> butterfly effect) and while it most likely is already overkill to render, 10 steps on that cosine-series are still quite limited to very small values...
At least that's what my testing gave... (I just tried that series manually a few days back ^^)

However, even with those possible inaccuracies, it might be an interesting set to see :)


Title: Re: Ideal 3D mandelbrot?
Post by: Tglad on January 05, 2010, 12:37:58 AM
And here's what it looks like (maybe someone else can do a better job with the lighting model)

First 2 only go up to the 1/24 (though adding the 1/720 makes little difference)
3rd is a zoom, using the 1/720 term
I'm not sure if the expansion still applies on a power 2 mandelbulb, but the 4th pic is what the crest looks like (also using 1/720 term), it doesn't look as pretty when seen from other angles.

I like the look, though as you can see, it is unconnected in places.


Title: Re: Ideal 3D mandelbrot?
Post by: cKleinhuis on January 05, 2010, 12:50:21 AM
hi there, first of all: you can use LaTex inside your posting here! there is a [tex] tag build in

and this looks like polynomal representation?
add a nice factor before, try to render it, but do not really know the derivative for it,
where the heck was the definition for deriving triplex addition of potentiation ?

.... :)


Title: Re: Ideal 3D mandelbrot?
Post by: BradC on January 05, 2010, 02:28:09 AM
where the heck was the definition for deriving triplex addition of potentiation ?
What's "potentiation"?


Title: Re: Ideal 3D mandelbrot?
Post by: kram1032 on January 05, 2010, 02:57:08 AM
Tglad: Interesting...

Very noisy but beautiful :)
I wonder what some antialiasing could do with it...

certain parts look like some kinds of 3D-Lévy-Curves....

Now I wonder... How would sin and cos in Triplex (and/or the Quaternion Triplex) look like?
both functions shouldn't suffer as much from the limitations as log does, at least if you look at the definitions of the series.... - they don't seem to hide any special problems...


Title: Re: Ideal 3D mandelbrot?
Post by: twinbee on January 05, 2010, 07:12:06 AM
Calcyman, welcome to the forum!

WOW!! This really looks as though it might have some potential. Dare I say it has a good chance of looking somewhat better than the 'classic' Mandelbulb?

I'm pretty sure it's not the holy grail (not even with using multiple or even infinite powers together), but the glimpses of ideal3 and ideal4 are fascinating.


Title: Re: Ideal 3D mandelbrot?
Post by: Calcyman on January 05, 2010, 03:46:14 PM
Quote
And here's what it looks like (maybe someone else can do a better job with the lighting model)

Thanks for rendering it. I particularly like the 3rd image, which resembles an ordinary Mandelbulb.

The 4th image resembles the Seahorse valley, in that it contains an infinite set of spirals. It might be interesting to probe that area of the fractal, to see whether it exhibits the same features as its 2D counterpart.


Quote
I like the look, though as you can see, it is unconnected in places.

These fractals are clearly more sophisticated than 2D Mandelbrot-Julia fractals, which are either completely connected or consist of Cantor dust of zero measure.



Quote
where the heck was the definition for deriving triplex addition of potentiation ?

The Maclaurin expansion is designed for real numbers; triplex numbers don't possess well-defined derivatives. Using the expansion is a way to 'cheat' and define any function in triplex algebra.


Title: Re: Ideal 3D mandelbrot?
Post by: mrrgu on January 05, 2010, 03:58:38 PM
What happens if you use your expression q^8 cos q directly and not the expansion ? Would that not be ideal?


Title: Re: Ideal 3D mandelbrot?
Post by: David Makin on January 05, 2010, 05:41:11 PM
What happens if you use your expression q^8 cos q directly and not the expansion ? Would that not be ideal?

Care to tell us how to get cos(q) (triplex) without using the expansion ? ;)


Title: Re: Ideal 3D mandelbrot?
Post by: kram1032 on January 05, 2010, 05:55:14 PM
Could someone plug the sin/cos series into mathematica to find solutions?
For sin and cos it should be easier than for log as the series are a lot clearer with less complex behaviour....


Title: Re: Ideal 3D mandelbrot?
Post by: BradC on January 05, 2010, 07:59:31 PM
I don't think knowing cos helps sum the original series because you can't factor the q^8 out because multiplication isn't associative. For example, q^{10}\neq q^8 q^2 in general, so

    a q^8+b q^{10}+c q^{12}+\cdots \neq q^8 \left(a+b q^2+c q^4+\cdots \right)

But it would still be interesting to know what the sin & cos series sum to. I have Mathematica; I'll try to post the results later today.


Title: Re: Ideal 3D mandelbrot?
Post by: kram1032 on January 05, 2010, 08:09:42 PM
a general quaternionic transform variant to triplex algebra was proposed too, recently...
Did anyone yet try to use that?
In the paper, it was concluded that the quaternion variant (expressing the mandelbulb formula as a quaternionic transform) is both comutative and associative... If that's true, it would be interesting to see what happens if you plug that into mathematica... Maybe the results are more correct, then....


Title: Re: Ideal 3D mandelbrot?
Post by: BradC on January 05, 2010, 08:33:50 PM
a general quaternionic transform variant to triplex algebra was proposed too, recently...
The one in this thread http://www.fractalforums.com/theory/the-real-math-of-the-mandelbulb/ (http://www.fractalforums.com/theory/the-real-math-of-the-mandelbulb/)?


Title: Re: Ideal 3D mandelbrot?
Post by: mrrgu on January 05, 2010, 08:45:37 PM
Oops :)
Perhaps numerically, solving the differential equation q'' +q = 0,  q(0) = (1,0,0)  and plugin triplexes instead of ordinary numbers...

What happens if you use your expression q^8 cos q directly and not the expansion ? Would that not be ideal?

Care to tell us how to get cos(q) (triplex) without using the expansion ? ;)


Title: Re: Ideal 3D mandelbrot?
Post by: kram1032 on January 05, 2010, 10:29:18 PM
The showed paper is the same but I think I found it in a different thread...
Will that give different results?

http://github.com/bonzini/mbulb/raw/master/mbulb.pdf <- that paper^^


Title: Re: Ideal 3D mandelbrot?
Post by: BradC on January 05, 2010, 11:27:59 PM
Yeah, same paper from Paolo Bonzini. I read it but I haven't tried playing with the formulas in it yet. I had a question about whether the two triplex rotations are collapsed into a single quaternion rotation, and whether that's valid when raising to a power, but I haven't looked into it.


Title: Re: Ideal 3D mandelbrot?
Post by: BradC on January 05, 2010, 11:29:21 PM
I just posted formulas for sin & cos here: http://www.fractalforums.com/theory/triplex-algebra/msg10952/#msg10952


Title: Re: Ideal 3D mandelbrot?
Post by: kram1032 on January 06, 2010, 12:03:54 AM
ah nice :)

Just looking into quaternions and dual quaternions...

http://www.euclideanspace.com/maths/geometry/rotations/conversions/eulerToQuaternion/index.htm <- euler to quaterion (euler consists of three angles... which of them need to be doubled?
http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/other/dualQuaternion/index.htm <- dual quaternion (if you use the first rotation and then translation variant, you could do a single but direct transform for the Mandelbulb)

in theory, all the needed information for triplex to quaternion should be there in just those two pages...

But especially because of three euler angles rather than two spherical ones, I'm a bit confused about how to get the correct formulae....

However, it could provide interesting (more vortexy) results if all the three euler angles get doubled (multiplied by n) and the radius gets treated just as usual.

the a b c component to be added in the end would go into the dual quaternion for translation.

Then simplify that as much as possible and you'd have your correct quaternion formula (hopefully)


Title: Re: Ideal 3D mandelbrot?
Post by: BradC on January 06, 2010, 03:57:01 AM
More pictures of q^8+\cdots, and also q^7+\cdots.


Title: Re: Ideal 3D mandelbrot?
Post by: Paolo Bonzini on January 06, 2010, 09:35:25 AM
> In the paper, it was concluded that the quaternion variant (expressing the mandelbulb formula as a quaternionic transform) is both comutative and associative... If that's true, it would be interesting to see what happens if you plug that into mathematica... Maybe the results are more correct, then....

To clarify, we have:

1) polar triplex -> multiplication is associative, exponentiation works, no definition of addition, can be converted to and from (2) using trigonometry.

2) cartesian triplex -> just a normal vector, so addition is trivial but triplex multiplication does not work (in general not associative, gives wrong results when it exhibits nonassociativity), and exponentiation requires pre-expanding the formulas using Mathematica or similar

3) quaternions -> can express a triplex in both cartesian form (just take the (2) representation and make a quaternion with real part zero) or polar form (see paper).  In the latter case, what you do is use a quaternion that represents a rotation.  So, at any point you have to make sure whether your quaternion is a rotation or a vector: if it is a rotation, you can convert it to a vector using qi\bar q, if it is a vector, the paper says how to convert it to a rotation. Rotation quaternions have basically the same properties as (1), except that performance is somewhat opposite: they can be converted quickly to and from cartesian form using multiplication/division/sqrt, but then multiplication and exponentiation are much more expensive than (1).  Since quaternions never rely on trigonometry, addition on the "rotation form" could be defined in principle, but the formula would be huge.  Also, I'm pretty sure that the result would not be distributive, but I might be wrong.


Title: Re: Ideal 3D mandelbrot?
Post by: Paolo Bonzini on January 06, 2010, 09:53:02 AM
Yeah, same paper from Paolo Bonzini. I read it but I haven't tried playing with the formulas in it yet. I had a question about whether the two triplex rotations are collapsed into a single quaternion rotation, and whether that's valid when raising to a power, but I haven't looked into it.

Yes, they are.  When you multiply two triplex numbers a and b, you have four rotations (az ay and bz by).  You reorder them as "az bz ay by" and multiply the resulting four quaternions.  All I did in the paper, besides showing how to write Mandelbulb iterations with quaternions, is to express the result in terms of the components of the quaternions that represent "az ay" and "bz by". This is actually easily done if you let the computer do the simplifications (I used Maxima).


Title: Re: Ideal 3D mandelbrot?
Post by: twinbee on January 06, 2010, 09:56:53 AM
I'm not sure if I'm replicating the same object shown as BradC or Tglad (though Tgald's looks closer I guess). To simplify things, I'll look at this below:

q --> q^8 - q^10/2 + c

(http://www.skytopia.com/project/fractal/new/other/cm-bulb.jpg)


...Or more explicitly:

q --> tadd[     tsub{ tpow(q,8) ,  tmul(tpow(q,10), 0.5)  }     ,     c ];



... where the above functions are defined as follows. Is multiplication/division defined okay?

Code:
triplex tadd(triplex a, triplex b) {
triplex n;
n.x = a.x + b.x;
n.y = a.y + b.y;
n.z = a.z + b.z;
return n;
}
triplex tsub(triplex a, triplex b) {
triplex n;
n.x = a.x - b.x;
n.y = a.y - b.y;
n.z = a.z - b.z;
return n;
}
triplex tdiv(triplex a, double b) {
triplex n;
n.x = a.x / b;
n.y = a.y / b;
n.z = a.z / b;
return n;
}
triplex tmul(triplex a, double b) {
triplex n;
n.x = a.x * b;
n.y = a.y * b;
n.z = a.z * b;
return n;
}


triplex tpow(triplex a, double p) {
triplex n;

double r     = sqrt(a.x*a.x + a.y*a.y + a.z*a.z) ;
double phi   = atan2( pow(a.x*a.x + a.y*a.y, 0.5) , a.z) ;
double theta = atan2(a.y , a.x) ;

r=pow(r,p);
phi = phi*p;
theta = theta * p;

n.x = r * sin(phi) * cos(theta);
n.y = r * sin(phi) * sin(theta);
n.z = r * cos(phi);
return n;
}


Title: Re: Ideal 3D mandelbrot?
Post by: BradC on January 06, 2010, 10:26:53 AM
I did the same thing you did twinbee, except that my phi measures angles up from the equator rather than down from the north pole. (I did it like bugman's thread http://www.fractalforums.com/theory/triplex-algebra/ (http://www.fractalforums.com/theory/triplex-algebra/).) I can't quite tell if Tglad's object matches one of ours.

My code is like yours except for just these lines:
Code:
triplex tpow(triplex a, double p) {

... same ...

double phi   = atan2( a.z , pow(a.x*a.x + a.y*a.y, 0.5) ) ;

... same ...

n.x = r * cos(phi) * cos(theta);
n.y = r * cos(phi) * sin(theta);
n.z = r * sin(phi);

... same ...

}


Title: Re: Ideal 3D mandelbrot?
Post by: BradC on January 06, 2010, 11:27:42 PM
The degree 2 version seems to have some potentially interesting areas. I'd like to see twinbee's nice lighting on it.


Title: Re: Ideal 3D mandelbrot?
Post by: TedWalther on January 07, 2010, 06:42:06 AM
That looks incredibly exciting, BradC!  I'm guessing as the iterations go up you'll find it is completely connected, as is the mandelbrot. For the order2 image, does it have an exact mandelbrot cross section somewhere?


Title: Re: Ideal 3D mandelbrot?
Post by: twinbee on January 07, 2010, 11:57:52 AM
I can't seem to get the same shape. Brad, can you do me a favour and just render z^2 (without the z^4, z^6 stuff as well), just to see if our basic shape is the same.

How many iterations are you using? Also love to see a zoom into the thin stalk section on the right.

It does look pretty interesting indeed.


Title: Re: Ideal 3D mandelbrot?
Post by: BradC on January 08, 2010, 02:08:50 AM
Brad, can you do me a favour and just render z^2 (without the z^4, z^6 stuff as well), just to see if our basic shape is the same.

If you're using the "n.z = r * cos(phi);" formula rather than the "n.z = r * sin(phi);" formula, then our results would look different. Here are plots of z --> z^2 + c (using the +sine formula). I don't see any bugs in my code, but I could have one (or more). I have both the cosine version (internally called White) and the sine version (internally called Nylander) implemented so I could render the cosine version too if you like.


Title: Re: Ideal 3D mandelbrot?
Post by: twinbee on January 10, 2010, 04:55:12 PM
Tidied up my code base, so we can look at this a bit more now. So... we're using the "Positive Z-component" version of the Mandelbulb, but how many iterations did you use? (I used 15 iterations below)

I have something pretty similar to you, though there are minor differences it would seem. For comparison, also see Paul Nylander's version here (http://www.fractalforums.com/theory/summary-of-3d-mandelbrot-set-formulas/?action=dlattach;attach=1023;image), or Jules Rules' version here (http://www.fractal.org/Mandelbulb-2.pdf).

Here's mine:
(http://www.skytopia.com/project/fractal/new/other/Mandelbulb-POSZ-pow2-iter15.jpg)


Title: Re: Ideal 3D mandelbrot?
Post by: twinbee on January 10, 2010, 05:39:37 PM
Here's the z^2 - z^4/2 + c adaption of my above order 2 bulb. This unfortunately doesn't seem to match your version at all. I used 15 iterations here...

(http://www.skytopia.com/project/fractal/new/other/calcyman-2-4-posz.jpg)


Title: Re: Ideal 3D mandelbrot?
Post by: Buddhi on January 10, 2010, 07:34:27 PM
@twinbee: Beautiful shapes. Could you describe what formulas did you use in post #28?


Title: Re: Ideal 3D mandelbrot?
Post by: gaston3d on January 10, 2010, 09:52:52 PM
Here's the z^2 - z^4/2 + c adaption of my above order 2 bulb.

this image shows real advantages of ambient occlusion shading model.
very impressive and inspiring render.


Title: Re: Ideal 3D mandelbrot?
Post by: BradC on January 10, 2010, 10:00:46 PM
Excellent images! I guess my images are obviously the ones that don't match everybody else's, lol. I'll try to figure out why...


Title: Re: Ideal 3D mandelbrot?
Post by: twinbee on January 11, 2010, 01:17:11 PM
Quote
@twinbee: Beautiful shapes. Could you describe what formulas did you use in post #28?

They're all simply different views of the "Positive Z-component" variation as first shown by Paul found here (http://www.fractalforums.com/theory/summary-of-3d-mandelbrot-set-formulas/?action=dlattach;attach=1023;image).

Here's the exponential function I use (p below =2 of course, as it's a quadratic Mandelbulb)

Code:
triplex tpowPOSZ(triplex &a, double p) {
triplex n;

     double r    = sqrt(a.x*a.x + a.y*a.y + a.z*a.z) ;
double theta = atan2(a.y , a.x) ;
double phi = atan2( a.z , sqrt(a.x*a.x + a.y*a.y) ) ;

r=pow(r,p); phi *=p; theta *=p;

n.x = r * cos(theta) * cos(phi) ;
n.y = r * cos(phi) * sin(theta);
n.z = r * sin(phi);
return n;
}


Quote
this image shows real advantages of ambient occlusion shading model.
very impressive and inspiring render.

Thanks!

Quote
Excellent images! I guess my images are obviously the ones that don't match everybody else's, lol. I'll try to figure out why...

One thing I noticed is that I have to use: phi = atan2( a.z , sqrt(a.x*a.x + a.y*a.y) ) ;   
...instead of Paul's recommended: phi = arcsin(a.z/r);

...which for some reason I can't get to work.


Title: Re: Ideal 3D mandelbrot?
Post by: bugman on January 11, 2010, 10:16:44 PM
You can only use phi = arcsin(z/r) if you define r = sqrt(x²+y²+z²):
http://www.fractalforums.com/theory/summary-of-3d-mandelbrot-set-formulas/

In order to make the formulas more compact on that post, I had originally defined r = (x²+y²+z²)^(n/2), not realizing that this altered my definition of phi. But since then I have gone back and changed it back to r = sqrt(x²+y²+z²), so everything should be consistent now.


Title: Re: Ideal 3D mandelbrot?
Post by: twinbee on January 12, 2010, 12:41:49 AM
That's how I have r defined in my tpowPOSZ function above. Any other idea what I could be doing wrong?


Title: Re: Ideal 3D mandelbrot?
Post by: LesPaul on January 12, 2010, 12:54:03 PM
...

(http://latex.codecogs.com/gif.latex?q_{n+1}=q_0+{q_n}^{8})
Fortunately, I have developed a solution: to make successive powers of q increasingly negligable. An easy way to do this is to use the factorial function:


(http://latex.codecogs.com/gif.latex?q_{n+1}=q_0+{q_n}^{8}-\frac{1}{2!}{q_n}^{10}+\frac{1}{4!}{q_n}^{12}-\frac{1}{6!}{q_n}^{14}+\frac{1}{8!}{q_n}^{16}+\cdots)

(http://latex.codecogs.com/gif.latex?=q_0+{q_n}^{8}-\frac{1}{2}{q_n}^{10}+\frac{1}{24}{q_n}^{12}-\frac{1}{720}{q_n}^{14}+\frac{1}{40320}{q_n}^{16}+\cdots)

If you haven't already noticed, this is equivalent to the Maclaurin expansion for the expression q^8 cos q.

...

Wow!  Very promising!

This raises lots of questions...  Some of the big ones:

1) Why start with q8?  Why not something slightly more general, such as:

   q_{n+1} = q_0 + \frac{q_{n}^2}{2!} + \frac{q_{n}^3}{3!} + \cdots

Or, more compactly:

   q_{n+1} = q_0 + \sum_{k=2}^\infty \frac{q_{n}^k}{k!}

It might be most consistent with the traditional Mandelbrot to leave the quadratic term unchanged, in other words, start the series at k = 1, yielding:

   q_{n+1} = q_0 + \sum_{k=1}^\infty \frac{q_{n}^{k+1}}{k!}

    = q_0 + {q_{n}^2} + \frac{q_{n}^3}{2!} + \cdots

2) Has anyone ever tried a similar approach in 2D?

Can't wait to see this explored further!


Title: Re: Ideal 3D mandelbrot?
Post by: Calcyman on January 18, 2010, 08:03:38 PM
Quote
Why start with q^8?

q^8 is the exponent for the original 3D Mandelbulb, so it made sense to begin there.

Quote
Why not something slightly more general, such as:

Some of the images in this thread are generated using q^2 and higher powers. The series you have posted is the logarithmic series expansion. The cosine series is faster to compute, as only even terms are considered.

Quote
Has anyone ever tried a similar approach in 2D?

Not that I know of.


I wonder whether the formula z = z² + c creates a fractal over the Griess algebra (as opposed to the complex plane). If it does, then you have a 196884-dimensional fractal with the same symmetries as the monster group. That would be spectacularly impressive.

http://en.wikipedia.org/wiki/Griess_algebra (http://en.wikipedia.org/wiki/Griess_algebra)


Title: Re: Ideal 3D mandelbrot?
Post by: LesPaul on January 23, 2010, 01:05:17 AM
Quote
Has anyone ever tried a similar approach in 2D?

Not that I know of.

I went ahead and tried it.  The results are kind of off-topic here, since this is thread is about 3D.  I posted what I found in a new thread here: http://www.fractalforums.com/index.php?topic=2483.msg12057#msg12057


Title: Re: Ideal 3D mandelbrot?
Post by: jehovajah on February 11, 2010, 05:37:05 AM
Here's the z^2 - z^4/2 + c adaption of my above order 2 bulb. This unfortunately doesn't seem to match your version at all. I used 15 iterations here...

(http://www.skytopia.com/project/fractal/new/other/calcyman-2-4-posz.jpg)


Seems to me that you have different bailout conditions, and possibly fine tuning settings. Your range seems different also. Stunning images as usual.

Tell me. does x=-.5 have any significance to the quadratic mandelbulb?


Title: Re: Ideal 3D mandelbrot?
Post by: jehovajah on February 11, 2010, 01:34:39 PM
Excellent images! I guess my images are obviously the ones that don't match everybody else's, lol. I'll try to figure out why...
 
Some differences in the underlying math, plus your rendering algorithm. Here are Terry Gintz shot at rendering
julia zcos(z)+c and mandy zcos(z)+c.

Then z2cosz+c  but based on "pixel"math. Compare with zplot math.I altered the colouring filterand increased iteration to 15. As you can see pixel math seems to give more details in the image.


Title: Re: Ideal 3D mandelbrot?
Post by: jehovajah on February 17, 2010, 05:58:39 AM
This is a side view.


Title: Re: Ideal 3D mandelbrot?
Post by: Calcyman on February 20, 2010, 10:37:10 PM
Based on my idea of multiplying trigonometric and polynomial components, bib discovered the fractal produced by the formula:

z = z * tan(z)

http://www.fractalforums.com/mandelbrot-and-julia-set/calcyman's-idea-(2d)/ (http://www.fractalforums.com/mandelbrot-and-julia-set/calcyman's-idea-(2d)/)

The resulting images are unusual even in two dimensions, and I cannot imagine what would happen if it were translated into 3D. The appropriate series expansion is:

z = z^2 + \frac{z^4}{3} + \frac{2z^6}{15} + \frac{17z^8}{315} + \cdots

Unfortunately, the series doesn't converge very quickly, compared with sine and cosine.


Title: Re: Ideal 3D mandelbrot?
Post by: Schlega on February 23, 2010, 06:14:45 AM
Hi, I'm a bit new here, so I apologise if this has been covered elsewhere, but I've been thinking about extending the z*tan(z)+c fraction.

My idea was to define (x,y,z)=(a,b,c)/(A,B,C) by

x = (1/R2)(aA+bB)(C/P-c/p)
y = (1/R2)(bA-aB)(C/P-c/p)
z = (1/R2)(cC+pP)

where R2= A*A + B*B +C*C
and p = sqrt(a*a + b*b)

for points off of the z-axis, and treat points on the z-axis as scalars. I know this is not entirely compatible with the mandelbulb definition of exponentiation, but I'm curious to see what the results look like.

From there, I want to define tan(z) by its continued fraction representation.

I'm trying to write the code for it myself, but it's probably not going to be done any time soon since I'm not a programmer. Has anyone tried this yet?


Title: Re: Ideal 3D mandelbrot?
Post by: Timeroot on February 23, 2010, 06:36:34 AM
That sounds interesting, I mean using the continued fraction expansion, but I'm confused by what you're doing with x,y,z,a,b,c,A,B,C, and about the difference between p and P. Could you elaborate?  :hmh:


Title: Re: Ideal 3D mandelbrot?
Post by: Schlega on February 23, 2010, 07:16:20 AM
Sorry about the a,b,c notation. When I was thinking about it I was typing in notepad, so I didn't have access to subscripts. Let me try again:

Let wi = (xi,yi,zi),
ri = (xi2 + yi2 + zi2)1/2, and
rhoi = (xi2 + yi2)1/2.

then if w3 = w1 / w2, then

x3 = (r2)-2(x1x2 + y1y2)(z2/rho2 - z1/rho1)
y3 = (r2)-2(y1x2 - x1y2)(z2/rho2 - z1/rho1)
z3 = (r2)-2(z1z2 + rho1rho2)


Title: Re: Ideal 3D mandelbrot?
Post by: kram1032 on February 23, 2010, 02:32:54 PM
hmmm... It would be easy to define tan by just doing sin(x)/cos(x) (and cot respectively), I guess...

Will that result in a different shape than the tan(x) series?


Title: Re: Ideal 3D mandelbrot?
Post by: Timeroot on February 24, 2010, 12:58:38 AM
Sorry about the a,b,c notation. When I was thinking about it I was typing in notepad, so I didn't have access to subscripts. Let me try again:

Let wi = (xi,yi,zi),
ri = (xi2 + yi2 + zi2)1/2, and
rhoi = (xi2 + yi2)1/2.

then if w3 = w1 / w2, then

x3 = (r2)-2(x1x2 + y1y2)(z2/rho2 - z1/rho1)
y3 = (r2)-2(y1x2 - x1y2)(z2/rho2 - z1/rho1)
z3 = (r2)-2(z1z2 + rho1rho2)
Irk, I'm sorry, that's all way over my head. Now I don't get the part about the subscripts... :-(

What about defining the tangent just with it's continued fraction rep, and then the sin and cos based on that (sqrt and sqr and w/e)?


Title: Re: Ideal 3D mandelbrot?
Post by: Schlega on March 14, 2010, 02:59:34 AM
Sorry it took so long to get back to this, Timeroot. The multiplication and division I had in mind was based on squaring the radius and doubling the angle in standard spherical coordinates, then converting to cartesian. Once I realized how problematic this definition could be, I stopped working on it for a while. Eventually, I decided to finish it even though it wouldn't be similar to triplex algebra.

   It looks like the continued fraction definition just results in a sphere, unless I did something stupid. I'll put the code here just in case there are glaring errors somewhere. I used ChaosPro:

Code:
Ztanzbulb(QUATERNION) {
parameter real bailout;
parameter int steps;
real pixelr,pixeli,pixelj;
real x1,x2,y1,y2,z1,z2,rho1,rho2,A,B,C;
quaternion res, res1,c;
int m;

quaternion inv(quaternion q)
{
q = q-quaternion(0,2*part_i(q),0,0);
q = q/|q|;
return(q);
}

quaternion mult(quaternion q, quaternion p)
{
x1 = part_r(q);
y1 = part_i(q);
z1 = part_j(q);
rho1 = sqrt(x1*x1+y1*y1);

x2 = part_r(p);
y2 = part_i(p);
z2 = part_j(p);
rho2 = sqrt(x2*x2+y2*y2);

if (rho1 == 0){
p =(z1*p);
} else if (rho2 == 0){
p = z2*p;
} else{
A = (x1*x2-y1*y2)*(z1/rho1+z2/rho2);
B = (x1*y2+x2*y1)*(z1/rho1+z2/rho2);
C = (rho1*rho2-z1*z2);
p = (quaternion(A,B,C,0));
}
return(p);
}
quaternion div(quaternion q, quaternion p)
{
x1 = part_r(q);
y1 = part_i(q);
z1 = part_j(q);
rho1 = sqrt(x1*x1+y1*y1);

x2 = part_r(p);
y2 = part_i(p);
z2 = part_j(p);
rho2 = sqrt(x2*x2+y2*y2);

if (rho1 == 0){
p =inv(p)*z1;
} else if (rho2 == 0){
p = p/z2;
} else{
A = (x1*x2+y1*y2)*(z1/rho1-z2/rho2)/|p|;
B = (x1*y2-x2*y1)*(z1/rho1-z2/rho2)/|p|;
C = (rho1*rho2+z1*z2)/|p|;
p = (quaternion(A,B,C,0));
}
return(p);
}

quaternion tangent(quaternion q)
{
res = 0.0;
for (m = steps+1; m>1; m=m-1){
res1 = mult(z,z)*(-1.0/(2*m-3)/(2*m-1));
res = div(res1,res+quaternion(0,0,1,0));
}
return(div(z,res+quaternion(0,0,1,0)));
}

void init(void)
{
pixelr=part_r(pixel);
pixeli=part_i(pixel);
pixelj=part_j(pixel);
c=quaternion(pixelr,pixeli,pixelj,0);
z=c;
}
void loop(void)
{
z=mult(z,tangent(z))+c;
}
bool bailout(void)
{
return(|z|<bailout);
}

void description(void)
{
this.title = "ztanzbulb";

bailout.caption = "Bailout Value";
bailout.default = 4.0;
bailout.min = 1.0;
bailout.hint = "Defines the bailout radius: As soon as a pixel falls outside a circle with this radius, the iteration stops.";

steps.caption = "Steps";
steps.default = 2;
steps.min = 1;
steps.hint = "Controls how deep into the continued fraction the tangent function goes.";

}
}


Title: Re: Ideal 3D mandelbrot?
Post by: Timeroot on March 14, 2010, 10:38:00 AM
 :dink: I found the error, it was pretty simple: in your "inv" definition, you say q=q/|q|. This should be q/(|q|^2). In ChaosPro, the || operator is the actual absolute value, not the the absolute value squared. The fact that all your variables reduced to unity within one reciprocation explains the sphere, I think. :) The same mistake is made, by the way, in the div function.


Title: Re: Ideal 3D mandelbrot?
Post by: Schlega on March 15, 2010, 11:35:11 AM
 :embarrass:  Thanks, Timeroot. At the moment, ChaosPro is busy animating a zoom into z^log(z)+c, but I'll change that as soon as it finishes.