Logo by AGUS - 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: Follow us on Twitter
 
*
Welcome, Guest. Please login or register. March 19, 2024, 09:12:42 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 ... 16 17 [18] 19 20 ... 37   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: True 3D mandelbrot type fractal  (Read 601622 times)
0 Members and 2 Guests are viewing this topic.
David Makin
Global Moderator
Fractal Senior
******
Posts: 2286



Makin' Magic Fractals
WWW
« Reply #255 on: September 29, 2009, 11:15:43 AM »

http://www.fractalforums.com/gallery/?sa=view;id=934
Logged

The meaning and purpose of life is to give life purpose and meaning.

http://www.fractalgallery.co.uk/
"Makin' Magic Music" on Jango
Karl131058
Forums Freshman
**
Posts: 18



« Reply #256 on: September 29, 2009, 02:58:34 PM »

I've asked Karl if he can help simplify the algorithm like he did before (to remove the sin/cos stuff) - the extra speed boost would be so welcome...

OK people, here we go:

simplifying your formulae on multiplying the angles by whatever integer. I have to admit I'm a little bit astonished about the fact that people who want to learn (or freshen up) multidimensional calculus by reading a book over the weekend don't seem to know about Euler's Formula or the Binomial Theorem. These (and the definition of tan() from sin() and cos() grin)are all that is needed to get rid of the trigonometric functions for every integer you may choose to multiply your angles by, and you will always have just polynomials in x,y and z, and the occasional sqrt(x^2+y^2). Minor drawback: these polynomials are getting more complicated the higher your "exponent" becomes, so there will be an exponent where working WITH trigonometric functions will be FASTER than with these polynomials; WHICH exponent that is probably depends on your math-library/processor, and I will NOT try to find it...

Suggested reading:
http://en.wikipedia.org/wiki/Euler%27s_formula
http://en.wikipedia.org/wiki/Binomial_theorem
http://en.wikipedia.org/wiki/Binomial_coefficient

The general argument works like this:

Euler's formula states that for any real number f
exp( i*f ) = cos(f)+i*sin(f)     ( i being sqrt(-1), of course )

Now, if you take an integer (say "n") multiple of f, you get (reversing the order)

cos(n*f) + i*sin(n*f) = exp( i*n*f )

The right side is, since it IS the exponential function, equal to (exp(i*f))^n !
So:

cos(n*f) + i*sin(n*f) = exp( i*n*f ) = (exp(i*f))^n = (cos(f)+i*sin(f))^n
(last equation comes from substituting the first one again)

By using the Binomial Theorem we expand
(cos(f)+i*sin(f))^n = Sum( k=0 to n, C(n,k)*cos(f)^k*i^(n-k)*sin(f)^(n-k) )

C(n,k) being the Binomial Coefficents

Remembering i^2 = -1 this sum can be sorted into real and imaginary parts, and we end with polynomial expressions for
cos(n*f) = real( Sum( k=0 to n, C(n,k)*cos(f)^k*i^(n-k)*sin(f)^(n-k) ) )
sin(n*f) = imag( Sum( k=0 to n, C(n,k)*cos(f)^k*i^(n-k)*sin(f)^(n-k) ) )

For shorter lines, I will write "F" (think "phi") instead of "zang", and "T" (think "theta") instead of "yang", if you don't mind...

We have
(old)x = r*cos(F)*sin(T)
(old)y = r*sin(F)*sin(T)
(old)z = r*cos(T)

and we want
newx = r^n*cos(n*F)*sin(n*T)
newy = r^n*sin(n*F)*sin(n*T)
newz = r^n*cos(n*T)

If we would insert the general expressions for sines and cosines of n*F and n*T here, everything becomes lengthy, so it is probably best to argue by example: LET n = 3:

Pascal's triangle states the relevant binomial coefficients are 1,3,3 and 1
(see example on the wikipedia page mentioned above):
(a+b)^3 = a^3 + 3*a^2*b + 3*a*b^2 + b^3, thus

( cos(f) + i*sin(f) )^3 =
          cos(f)^3 + 3*cos(f)^2*i*sin(f) + 3*cos(f)*(i*sin(f))^2 + (i*sin(f))^3

remember that i^2 = -1, thus i^3 = -i, sort into real and imaginary parts and find
a) for the real part:          cos(3*f) = cos(f)^3 - 3*cos(f)*sin(f)^2
b) for the imaginary part: sin(3*f) = 3*cos(f)^2*sin(f) - sin(f)^3

so we have:
newx = r^3 * (cos(F)^3 - 3*cos(F)*sin(F)^2) * (3*cos(T)^2*sin(T) - sin(T)^3)
newy = r^3 * (3*cos(F)^2*sin(F) - sin(F)^3) * (3*cos(T)^2*sin(T) - sin(T)^3)
newz = r^3 * (cos(T)^3 - 3*cos(T)*sin(T)^2)

"newz" seems most simple, relatively speaking. Let's factor out cos(T)^3, and remember the definition of the tan():

newz = r^3 * cos(T)^3 * ( 1 - 3*tan(T)^2 )

but remember:
1) r^3*cos(T)^3 = z^3 !
2) tan(T) = sqrt(x^2+y^2)/z

thus newz = z^3 * ( 1 - 3*(x^2+y^2)/z^2 ) = z * ( z^2 - 3*x^2 - 3*y^2 )

This can be done for EVERY exponent; you can always factor out cos(T)^n from newz and are left with z^n and a polynomial in tan(T), which can be expressed in x,y,z using formula "2" above.

For newx, we factor out sin(T)^3 from the second bracket and get

newx = r^3 * sin(T)^3 * (cos(F)^3 - 3*cos(F)*sin(F)^2) * (3*tan(T)^-2 - 1 )

now, one "r", one "sin(T)", and one of the factors in the first bracket always combine to an old coordinate, and tan(T)^-2 = z^2/(x^2+y^2), so

newx = ( x^3 - 3*x*y^2 ) * ( 3*z^2 - x^2 - y^2 ) / ( x^2+y^2 )

by the same arguments:
newy = ( 3*x^2*y - y^3) * ( 3*z^2 - x^2 - y^2 ) / ( x^2+y^2 )

This can in principle be done for every exponent, too; you always factor out sin(T)^n from the second bracket, than you combine one "r", one "sin(T)" with a cos(F) from the first bracket into x, or with a sin(F) from the first bracket into y; and the second bracket is a polynomial in ( z/sqrt(x^2+y^2) )

Minor drawback again, more explicitly: each of these brackets has, in the general case for "exponent" n, exacly (n+1) summands, as per Binomial Theorem. I personally would not want to find the closed expressions as above for, say, n>8 or so, and definitely NOT for n=32. I am quite sure that, even if one would use one of those symbolic algebra thingies to find the correct polynomials, for n=32 using the trigonometric functions will be faster, since these polynomials are of order n (=32), all of them!

I hope this was helpful.
I hope I didn't step on anyones toes (too heavily  smiley ).
Any grammatical errors or strange english formulations are due to me being german, but the math SHOULD be sound!

Have fun
Karl
« Last Edit: September 29, 2009, 06:46:08 PM by Karl131058, Reason: some minor typos corrected... » Logged
David Makin
Global Moderator
Fractal Senior
******
Posts: 2286



Makin' Magic Fractals
WWW
« Reply #257 on: September 29, 2009, 07:56:15 PM »

I've asked Karl if he can help simplify the algorithm like he did before (to remove the sin/cos stuff) - the extra speed boost would be so welcome...
simplifying your formulae on multiplying the angles by whatever integer. I have to admit I'm a little bit astonished about the fact that people who want to learn (or freshen up) multidimensional calculus by reading a book over the weekend don't seem to know about Euler's Formula or the Binomial Theorem.

Hi Karl, In my case I was hoping for a magical formulaic solution that would remove the trig for any degree of the formula but I guess that's probably not possible especially since (as shown by Paul) the degree 4 is not the same as repeating the degree 2 smiley

More interesting to me would be to find a "divide" such that (a*b)/b is a and/or a*(b/a) is a where the "multiply" is:

{xa,ya,za}*{xb.yb,zb} = r{cos(theta)cos(phi),sin(theta)cos(phi),-sin(phi)}
where:
r = sqrt((xa^2+ya^2+za^2)*(xb^2+yb^2+zb^2))
theta=atan(ya/xa)+atan(yb/xb), phi=atan(za/sqrt(xa²+ya²))+atan(zb/sqrt(xb²+yb²))

however my maths makes me suspect that it's not possible but is not advanced enough to confirm that suspicion or disprove it by finding a solution.
Logged

The meaning and purpose of life is to give life purpose and meaning.

http://www.fractalgallery.co.uk/
"Makin' Magic Music" on Jango
David Makin
Global Moderator
Fractal Senior
******
Posts: 2286



Makin' Magic Fractals
WWW
« Reply #258 on: October 01, 2009, 03:07:50 AM »

A 3rd degree Julia:



If no image above then go here:

http://makinmagic.deviantart.com/art/3rd-Degree-Julia-138800953
Logged

The meaning and purpose of life is to give life purpose and meaning.

http://www.fractalgallery.co.uk/
"Makin' Magic Music" on Jango
Karl131058
Forums Freshman
**
Posts: 18



« Reply #259 on: October 01, 2009, 07:25:19 AM »

More interesting to me would be to find a "divide" such that (a*b)/b is a and/or a*(b/a) is a where the "multiply" is:

{xa,ya,za}*{xb.yb,zb} = r{cos(theta)cos(phi),sin(theta)cos(phi),-sin(phi)}
where:
r = sqrt((xa^2+ya^2+za^2)*(xb^2+yb^2+zb^2))
theta=atan(ya/xa)+atan(yb/xb), phi=atan(za/sqrt(xa²+ya²))+atan(zb/sqrt(xb²+yb²))

Hi David,

now that one could be tricky...
First of all I prefer, as you do here, measuring one of the angles against the x-y-plane and not against the z-axis, because this ensures that in the x-y-plane it replicates complex multiplication. So we're back to the system twinbee proposed near the beginning of this thread...

My first reaction was like: there can't be a divide as you are looking for, cause that would define a group-structure on the 2-sphere, and that doesn't exist. See wikipedia:lie-groups for that statement; the proof is outside of my mathematical skills, too smiley

BUT since (a*a)*(a*a) != a*(a*(a*a)) (as shown by Paul) that "multiplcation" is not associative, so your goal wouldn't be in  contradiction to said statement. Nevertheless, the search for something like that calls for a quiet afternoon (at least, maybe a FEW), and I'm short of those for the time being  grin

Nice problem - there's a weekend ahead, maybe I'l have some time - but again, maybe not!

Have fun
Karl
« Last Edit: October 01, 2009, 07:27:16 AM by Karl131058 » Logged
David Makin
Global Moderator
Fractal Senior
******
Posts: 2286



Makin' Magic Fractals
WWW
« Reply #260 on: October 01, 2009, 11:13:14 AM »

Hi Karl, thanks for that...if you do ever find a "divide" at least for either a=(a*b)/b or a=a*(b/a) then I'd love to see it - I fancy trying a version of the Newton and similar fractals with this method - next I am going to see what happens using the "divide" I suggested earlier in the thread when applied in a "Newton" formula.
Logged

The meaning and purpose of life is to give life purpose and meaning.

http://www.fractalgallery.co.uk/
"Makin' Magic Music" on Jango
twinbee
Fractal Fertilizer
*****
Posts: 383



WWW
« Reply #261 on: October 01, 2009, 03:32:43 PM »

Many thanks Karl for the formulae - it actually works around 10x faster than before!! I hope to extrapolate the technique to order 4 or even 8.

Keep up the good work guys...
Logged
Ought
Guest
« Reply #262 on: October 02, 2009, 03:40:35 AM »

Hi all. I've been lurking here for a month or so since Twinbee posted some questions on Physics Forum. You've created an amazing synthesis between you all. Very impressive, and it's working. I've put in many hours attempting to find a mandelbrot variant without success. You've been at it more than two years! Persistence paid off.

Beautiful creations, David. Despite that I'm primarily looking toward mandelbrots the Julias you've come up with are very pleasing. I like the metallic look.

By the way, Twinbee. This is Phrak.
----------------------------------------------------------------------------------------
This is for cut and paste. Some of this might help with presenting the mathematical notation.

α β γ δ ε ζ η θ ι κ λ μ ν ξ ο π ρ ς σ τ υ φ χ ψ ω . . . . . Γ Δ Θ Λ Ξ Π Σ Φ Ψ Ω
∂ ∫ ∏ ∑ . . . . . ← → ↓ ↑ ↔ . . . . . ± − • × ÷ √ . . . . . ¼ ½ ¾ ⅛ ⅜ ⅝ ⅞
∞ ° ² ³ ⁿ Ã… . . . . . ~ ≈ ≠ ≡ ≤ ≥ « » . . . . . † ‼

To enter supscripts and subscripts use

[ sup]2[ /sup]  and [ sup]2[ /sup]

with the spaces removed from within the brackets.


Logged
Karl131058
Forums Freshman
**
Posts: 18



« Reply #263 on: October 02, 2009, 09:37:56 AM »

@Ought: thank you for the help for the mathematical notation. However, in this post I'll try to refrain from using complicated formulae...

@David:
I'm sorry, but there is no "divide" like the one you are looking for!

Think spherical coordinates: we "multiply" two vectors by multiplicating the radii to get the new radius and adding the azimuth angles and elevation angles to get the new angles; the "-" in z (i.e. in elevation) doesn't make that much of a difference.

As long as the sum of the elevations is inside the interval ±900, there's no problem: take one of your "factors", invert the radius, let both angles change sign and you've got an inverse...or so it would seem! But hang on: that is only correct on the x-y-plane (small wonder, since there we have complex multiplication, a FIELD!), but NOT outside of that plane!

Suppose the sum of the elevations is exactly 900, so the "product" points along the negative z-axis.
Then there is no chance to reconstruct the original azimuth angle, that information is lost forever.

If the sum of the elevations is bigger than 900, the azimuth of the result gets another half turn and the elevation gets "reflected" around 900, but you can't recognize that if you only know the "product" and one of the "factors". So for given product "p" and factor "f" there can be several (here: two) second factors "a" that fulfill a*f=p; in case of results on the z-axis and given factor not on the z-axis there are even infinitely many of them. Which one of these would you like to choose for "p/f" smiley?

(This "turnaround" is responsible for there being FOUR solutions "a" to a2 = p (in general), as pointed out earlier in this thread when somebody calculated backwards orbits.)

All this is only valid if the given factor's elevation and the products negative(!) elevation differ from each other by less than 900, else there is no second factor to find to give the desired product. As an example, there is no factor "a" which you can multiply to a given factor "f" with any positive elevation phi to result in a product on the positive z-axis. Suppose a's elevation were PHI, than phi+PHI = -900, but thats impossible, since PHI can't be less than -900.

So here you are; with given f and p, searching for "a" with a*f=p, you either have
- finitely many solutions (from which you could choose a "canonical", e.g. that without elevation-overflow), or
- infinitely many solutions, where the choice would be arbitrary in azimuth, or
- NO solutions at all!


Sorry!

Have fun
Karl
« Last Edit: October 02, 2009, 11:57:55 AM by Karl131058, Reason: minor errors... » Logged
cKleinhuis
Administrator
Fractal Senior
*******
Posts: 7044


formerly known as 'Trifox'


WWW
« Reply #264 on: October 02, 2009, 12:55:25 PM »

@all
Fractalalforums.com has a build in LateX Compiler ... there is no need for special signs!

Example:
[ tex]\sum^n_0 x[/tex]
\sum^n_0 x
Logged

---

divide and conquer - iterate and rule - chaos is No random!
Buddhi
Fractal Iambus
***
Posts: 895



WWW
« Reply #265 on: October 02, 2009, 05:47:20 PM »

I have just rendered z7+b Mandelbrot fractal. I used following shading algorithms together:
- hard shadows
- angle of incidence of light based on estimated normal vectors
- global illumination


Full resolution: http://krzysztofmarczak.deviantart.com/art/z7-b-3D-fractal-2-138950342

rendering statistics:
number of iterations: 256
slices resolution: 1500x1500x1500 (used symmetries to achieve final resolution 3000x3000x3000)
image resolution: 3000x3000
global illumination number of rays: 150
render time of slices: 60h
render time of image: 8h
Logged

twinbee
Fractal Fertilizer
*****
Posts: 383



WWW
« Reply #266 on: October 02, 2009, 06:39:02 PM »

Wow, that's stunning - glad to see one from you Buddhi! 256 iterations is overkill for this one though haha. Even 10 iterations gets enough detail for 100x100 zooms. Although weirdly enough, the iteration 'limit' of this set does seem to converge to an object with some kind of 'frothy' detailed structure (unlike the 2D mandelbrot which evolves to mere circles). I'm currently rendering out a 100,000 iteration image at 4000*4000 pixels. I suppose that's even more overkill wink

I still wonder if the set is connected or locally connected.

Ought, welcome to this particular corner of the interweb! cheesy
« Last Edit: October 02, 2009, 06:49:34 PM by twinbee » Logged
David Makin
Global Moderator
Fractal Senior
******
Posts: 2286



Makin' Magic Fractals
WWW
« Reply #267 on: October 02, 2009, 07:32:37 PM »

<snip>
So here you are; with given f and p, searching for "a" with a*f=p, you either have
- finitely many solutions (from which you could choose a "canonical", e.g. that without elevation-overflow), or
- infinitely many solutions, where the choice would be arbitrary in azimuth, or
- NO solutions at all!


Sorry!

Have fun
Karl

Thanks Karl - you not only answered the question but also explained it in a way that improves my (current) understanding of math - I'm sure at one time (say around 20 years ago) I would have figured that out myself but unfortunately a lot of my math knnowledge has lapsed over the years and I have to relearn things that I've forgotten smiley (At one time I even knew how to solve differential equations but doing that now would take some considerable re-learning)
Logged

The meaning and purpose of life is to give life purpose and meaning.

http://www.fractalgallery.co.uk/
"Makin' Magic Music" on Jango
David Makin
Global Moderator
Fractal Senior
******
Posts: 2286



Makin' Magic Fractals
WWW
« Reply #268 on: October 02, 2009, 07:57:30 PM »

I have just rendered z7+b Mandelbrot fractal. I used following shading algorithms together:

Nice work !

Just a small point, anyone thinking that it's not a connected Mandelbrot should not come to that opinion based on Buddhi's image because the rendering method used (based on a voxel grid and iteration values) will always miss areas of "solid".

Also I have improved my directional DE rendering algorithm so that (extra) black outlines are averted by changing the normal calculation to using the directional DE values from points on the adjacent rays that are the same distance from the viewpoint as the central "solid" pixel -> this means that a fractal lit by a non-viewpoint light source can be rendered by tracing just 2 rays per pixel instead of 6 and the method is 2 to 3 times faster and gives better details (it's not always 3 times faster because in many cases tracing back to the general light source takes a lot longer than the trace/s to the object from the viewpoint).
I am going to see how far I can push the closeness to "inside" in an 8000*8000 render of the degree 4 "true 3D" Mandy (as soon as I've optimised the formula a bit more) smiley

Logged

The meaning and purpose of life is to give life purpose and meaning.

http://www.fractalgallery.co.uk/
"Makin' Magic Music" on Jango
lycium
Fractal Supremo
*****
Posts: 1158



WWW
« Reply #269 on: October 03, 2009, 02:26:42 PM »

updated: bigger image preview, click for 3840x2400

« Last Edit: October 18, 2009, 05:21:18 AM by lycium » Logged

Pages: 1 ... 16 17 [18] 19 20 ... 37   Go Down
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
Implementation: 3D mandelbrot type fractal 3D Fractal Generation « 1 2 » steamraven 27 64411 Last post August 21, 2016, 12:13:13 AM
by ironfractal
Re: True 3D mandelbrot type fractal Other / General Discussion shanest 2 26268 Last post November 20, 2009, 03:24:26 AM
by fractalrebel
True 3D mandelbrot fractal (search for the holy grail continues) The 3D Mandelbulb « 1 2 ... 17 18 » illi 260 57190 Last post November 25, 2010, 12:57:55 AM
by cKleinhuis
New fractal type... latest 3d type.. a z^2 for Benoit Images Showcase (Rate My Fractal) M Benesi 0 7431 Last post October 21, 2010, 07:14:00 AM
by M Benesi
My First Mandelbrot...Okay not true. Images Showcase (Rate My Fractal) Zephitmaal 3 8246 Last post January 07, 2012, 04:30:36 PM
by Pauldelbrot

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