Welcome to Fractal Forums

Fractal Math, Chaos Theory & Research => (new) Theories & Research => Topic started by: Kabuto on January 11, 2013, 10:21:33 PM




Title: Actual 3D newton fractals
Post by: Kabuto on January 11, 2013, 10:21:33 PM
I'd like to share something I discovered a while ago: real 3D newton fractals. I couldn't find existing posts/usage of this method so I'm posting it here.


Background: when I was a child and playing around with fractal algorithms on a PC I of course also wrote newton fractals and tried lots of variants.

A special one I tried was: "What if I replace the function f in x := x-f(x)/f'(x) with its absolute value?" Of course I had to adjust the formula itself, too - f is now rather like a terrain (as it yields a nonnegative real value (height) for every complex input (position on ground plane)). Determining the value and derivative at a given x now gives a tangential plane and I simply pick the intersection with the ground plane that's closest to x. (|f(x)|' being the vector of deriving |f(x)| spatially by each of x's components we get the new formula as: x := x - |f(x)|*|f(x)|'/|f(x)|'²)

Surprisingly the resulting "newton" fractal looked exactly the same as the original complex newton fractal. And I was puzzled as didn't expect that and also couldn't explain that. (Nowadays I know that it's due to f(x) being holomorphic.)


Later I was thinking about the problem of expanding 2D fractals to 3D. As it's well-known there's no natural extension of complex numbers to 3 dimensions. But then I remembered my discovery above as it yields a natural extension at least for this specific kind of newton fractal. By transforming |f(x)| for f(x) = x³-1 I get:

|x³-1| = |(x-1)(x+.5+i*sqrt(3)/2)(x+.5-i*sqrt(3)/2)| = |x-1|*|x+.5+i*sqrt(3)/2|*|x+.5-i*sqrt(3)/2|

The right part has one factor per null of the original polynomial. And it no longer does any fancy stuff with complex numbers, just adding and subtracting, so it works with vectors as well. And extending that to more than 2 dimensions is trivial.

GLSL pixel shaders (running in your browser) for a simple 3D newton fractal of a polynom with one null for each of a tetraedron's 4 vertices:

* cross section: http://glsl.heroku.com/e#1348.2 (http://glsl.heroku.com/e#1348.2)
* flight through fractral rendered as fog: http://glsl.heroku.com/e#1368.0 (http://glsl.heroku.com/e#1368.0)


Title: Re: Actual 3D newton fractals
Post by: DarkBeam on January 12, 2013, 12:02:40 AM
Sorry... but where is the fractal detail?
By the way welcome!


Title: Re: Actual 3D newton fractals
Post by: Kabuto on January 12, 2013, 12:27:05 AM
Yes that's a problem: there's no real 3D fractal detail. 3D structure is mostly elongated and bent 2D structure. Maybe a consequence of having chosen the simplest possible way. Nature is just too lazy to add additional details on its own for further dimensions unless being forced to :D

I've also taken a look at examples where a mandelbrot set occurs within a newton fractal. I've seen 2 examples so far (one is here (http://de.wikipedia.org/w/index.php?title=Datei:Newton-lplane-Mandelbrot-smooth.jpg&filetimestamp=20081017234443)) but none of these has a natural extension to 3D. Both work by introducing a varying "constant" to the newton fractal formula and plotting the behaviour depending on the constant's value. But that's also the problem: this added parameter makes it impossible to convert the formula to vector arithmetics and thus to naturally extend it to 3 dimensions.


Title: Re: Actual 3D newton fractals
Post by: cKleinhuis on January 12, 2013, 12:50:28 AM
hello and welcome to the forums ;)

problem with newton is that its bailout condition is opposite to normal escape time conditions :( the newton bails out when a certain value is undergone, whereas normal mandelbrot bailout is reached when a certain value is over-gone ... nice thoughts anyways, and surely worth to think about how to implement a newton 3d fractal ;)


Title: Re: Actual 3D newton fractals
Post by: DarkBeam on January 12, 2013, 09:13:41 AM
Well inside DIFS shapes it should not be a problem because you can write the DE in a custom way. The problem would be to make it linear using derivates... :(


Title: Re: Actual 3D newton fractals
Post by: kram1032 on January 12, 2013, 11:36:23 AM
Nature is just too lazy to add additional details on its own for further dimensions unless being forced to

Pfft. On the contrary. Nature is too lazy to find really complicated solutions when simple fractals do the job just perfectly fine.

Awesome discovery there, though!

Note though: Newtonian fractals aren't the most amazing when it comes to fractal details.
You can sort of see these patterns in the 3D cloud:
(http://www-user.tu-chemnitz.de/~uro/teaching/SS2012-numerik/ueb06/newton-fractal.png)
Just imagine cutting through one of those sections perpenticularly. You'd most certainly get patterns close to the cross-section shown above.

By the way, could you try the secant method too? It doesn't require a derivative at all and it produces slightly richer fractal patterns, because the fractalness of the patterns here sort of actually is an unwanted effect of a not-so-well-converging series. The secant method converges even slower and brings out the patterns more.
(There was a post on this way back on this forum. I remember somebody trying all kinds of Runge-Kutta methods as variations on the Newton method and then heading back to secant because that was the most interesting one by far)


Title: Re: Actual 3D newton fractals
Post by: Kabuto on January 12, 2013, 03:02:16 PM
I just tried the secant method. Looks nice. (http://glsl.heroku.com/e#5963.0 (http://glsl.heroku.com/e#5963.0)).

But I don't think this can be transferred to 3D using my method because that would require converting the 2D variant to operate as well on a C -> R formula (e.g. the terrain analogon). And the secant method doesn't work well on terrains as it won't be able to break out of the straight line defined by the 2 starting points.


Title: Re: Actual 3D newton fractals
Post by: Alef on January 12, 2013, 05:26:02 PM
Cool. These rings are details;) Throught webGL crashed my windows;) Could this benn made solid with 3 threads.


Title: Re: Actual 3D newton fractals
Post by: David Makin on January 12, 2013, 08:38:19 PM
Hypercomplex (bi-complex) Newton cut to a sphere:

http://www.renderosity.com/mod/gallery/index.php?image_id=1181285&user_id=40328&page=6&member&np (http://www.renderosity.com/mod/gallery/index.php?image_id=1181285&user_id=40328&page=6&member&np)


Title: Re: Actual 3D newton fractals
Post by: JosLeys on January 14, 2013, 11:52:10 AM
Look here : http://www.josleys.com/show_gallery.php?galid=338 (http://www.josleys.com/show_gallery.php?galid=338)


Title: Re: Actual 3D newton fractals
Post by: Kabuto on January 15, 2013, 09:58:09 PM
Look here : http://www.josleys.com/show_gallery.php?galid=338 (http://www.josleys.com/show_gallery.php?galid=338)
That was not what I meant. I was talking about fractals that are defined in 3 dimensions, not 2D fractals rendered as terrains.

But nonetheless, thanks for sharing that. I improved the cross section of my fractal by rendering the part below the cross section plane in 3D: http://glsl.heroku.com/e#6026.0 (http://glsl.heroku.com/e#6026.0)
Furthermore, the same fractal clipped to a sphere: http://glsl.heroku.com/e#6026.2 (http://glsl.heroku.com/e#6026.2).
(Warning: the shaders behind these links are demanding to the GPU / gfx driver and might hang your browser or computer)


Title: Re: Actual 3D newton fractals
Post by: kram1032 on January 16, 2013, 10:44:59 PM
really nice :)


Title: Re: Actual 3D newton fractals
Post by: Pauldelbrot on January 18, 2013, 03:42:13 PM
Fascinating.

There may be a second way to generalize Newton fractals to more dimensions also. Given

(http://i46.tinypic.com/167plc5.png),

compute

(http://i49.tinypic.com/rqytlg.png)

where the denominator is the gradient at x and the division on the right hand side is done by dividing the scalar F(x) by each coordinate of the gradient vector. Each coordinate is thus subjected separately to vanilla Newton's method, with the partial derivative in that coordinate. In theory this should work for any continuous, differentiable real-valued function of a vector space. And "real" can be upgraded to "complex" throughout.

It might also be possible to extend it to some discrete spaces, using a finite field in place of "real" or "complex". However, derivatives and gradient don't exist there, so it would have to be changed to a difference equation of some sort. A (partial) derivative might have to be replaced by, say, f(x + 1) - f(x), for example.


Title: Re: Actual 3D newton fractals
Post by: David Makin on January 19, 2013, 02:20:07 AM
Quaternionic Newton cut to a sphere and sliced to show the hollows:

https://www.youtube.com/watch?v=dnI6r3xsHPE (https://www.youtube.com/watch?v=dnI6r3xsHPE)


Title: Re: Actual 3D newton fractals
Post by: Kabuto on January 20, 2013, 11:30:47 AM
Fascinating.

There may be a second way to generalize Newton fractals to more dimensions also. Given

(http://i46.tinypic.com/167plc5.png),

compute

(http://i49.tinypic.com/rqytlg.png)

where the denominator is the gradient at x and the division on the right hand side is done by dividing the scalar F(x) by each coordinate of the gradient vector. Each coordinate is thus subjected separately to vanilla Newton's method, with the partial derivative in that coordinate. In theory this should work for any continuous, differentiable real-valued function of a vector space. And "real" can be upgraded to "complex" throughout.

Just tried that, doesn't really work because when F(x) is large but ▼F(x) is close to zero for one coordinate this coordinate will get very large in the result. Example:

F(x) = |x|² -> ▼F(x) = 2x

x0 = (1,0.01) -> x1 = (1,0.01) - 1.0001 / (2*(1, 0.01)) = (0.49995, -49.995)

I've also tried to render that but all I get is some colorful dust but no real structures. The formula seems to be incapable of actually reaching the nulls, unfortunately.


Title: Re: Actual 3D newton fractals
Post by: cKleinhuis on January 20, 2013, 11:34:41 AM
first: [ latext ] can be used in postings

second: never use == on comparing floats or doubles, i think you run into a classical instability problem of floating point representation here ;)

use a small delta bias to check if it is so close to zero as you like ;)

just my five cents!


Title: Re: Actual 3D newton fractals
Post by: Pauldelbrot on January 20, 2013, 03:39:26 PM
What about this? Compute the gradient vector g at x, then compute x - gF(x)/|g|2. That moves x in the direction opposite g and moves it a distance equal to F(x)/|g|.

In your example, (1,0.01) is now moved by (-1,-0.01) divided by the square root of 1.01, so almost right onto zero.


Title: Re: Actual 3D newton fractals
Post by: David Makin on January 20, 2013, 05:22:13 PM
One problem with using methods that converge faster/better than Newton's is (as already mentioned) that you lose any fractal detail - in fact I think I remember trying one myself (Householder's?) and got 3 perfect triangles with straight edges !!

Maybe the extension to general 2D using Jacobian methods can be extended to 3D ?

Edit: Of course the Jacobian does get a little messy using 3 dimensions instead of 2 ;)

See my "Multivariable Newton" formula in mmf3.ufm for Ultra Fractal which essentially gives the Newton for any system of 2 reals - actually it would of course be easy to convert to any system of 2 complex ;) (Which of course gives us 4 dimensions to play with without too much difficulty)

Example:

Code:
GeneralNewton {
::TnLWlin21Z1SvNuNQ47Gw/HE0pNoI2iSWKKNgX6+ooLQ2L52iCsghiUm1SUCUUxS5XfnhkS2
  uBFwAe484jz8xhDl0w4WWzvvdTUkVZbE04/UoFGWzPEntd64ozqK7R6jplRHFq6jWaxjFRNs
  ZhZgSww4GRlyOQj/C7NR0zsTK9Tk9pJwPS2TfJ67L6SDKJPdtnJ7z3n+3IQBLqqgpi9EwUSS
  5TfD2ChRdK6lG1/cSYaZ6neYfaGaNNe7GX64qBOr3q6004/gxPVb6G1VxRd9MuyOTJJJRtC7
  xuKa7YjV1zGG2upl13r01+wFarwQz2lTKKyOkfIfPZXeaSZ5DlRtsaNNZXSK5hki0tbkdGAG
  mLwW2kCjE3iehhfUwPR7kyIpqRoZtAv22Kz2NKbjR/h9xMTjf+5vlxu3T1PjpUcU/vGaZNNv
  yUNUen+NhpGcGUja6GB+PPPrYXCiyqSCl817LxYP2dGKI6sYAWNOIej1MKo/cwyMWvme1koh
  +5ONoTbH84A6xa3IoJ7T8rH4ModgsDXOc2jzaUOdek8Y7hZ48NoMc+GQwcD4efuNoqbZUdHI
  2b6qG5WYRAFRj00Z9GZ6ak0BJbA1WKx9PcYsnEJ/lUToqKYf9RLrE1GhgmBy1XJ7rgkd5ugf
  3l1rL5I2+45Th9hPvIMlG2S+EqL1ZMle/iyM08S0poLZenBfyCYlBavn4UfYFtM03DhwAnLu
  AjPAnt5LBkvKdADNPgCmLJXnC+dLkyHohicO3RZoyiLQiAVsE6BHW5r5nDo0ALgJyiJHWFOU
  LcMhHBWVlcUzDHySpeiCNM4RBKOqhGrKvh5LrqvsKcGCOnej9rXiWvN6pbD/1xapay3/g70t
  Qd9SId5dCp07LXOh9qBuoeK04ylzLS1rSSspIo8ioca+GEu4+8F39ib3o0DQfrf2rhpHkwAE
  dnWsdDcl+jmaUaBz8hJK8m4rHnIv/rT2PraUsYfWEm4F/CcOUxMVRwl432Ff1EFSapLzqYj2
  uwJXf3ZYLTXOWR6SOWVLCkqT0XPOZySxhbMcJXQfhBD16sHDXp7bUWaqznumK3syfgIhSwNz
  wVcc1Z/zM5JL0YTXtz//qyPIc4k4cwfcKhXCOvXHZY6Pbo5LhDWcR4MdZ2aYgJ/qam/xim/f
  La+NVNf94FGFWtOAzvELrwlsL0S83HHsRY9wwHqwjB+K5smw4g/lkahuiJRgow4C5/j24fk3
  4rEH/Kmjfh64Xzd8bJP+NsHmWwjaDilQf/V2gCetl96wnUw7j7/EKZEsm7+Nyd3F6Af3/KQy
  Oc0jq338XbYVKIvc94DtYririV6KxEN7xIow7M0HyfMPn8YQNhcIonkCyFZZBDpJuJYeblFl
  HKILIVuGS5hM4LWCfNw17LUcenTW/Wh088tb+XwTDleV
}



Title: Re: Actual 3D newton fractals
Post by: Kabuto on January 21, 2013, 07:37:23 PM
What about this? Compute the gradient vector g at x, then compute x - gF(x)/|g|2. That moves x in the direction opposite g and moves it a distance equal to F(x)/|g|.

In your example, (1,0.01) is now moved by (-1,-0.01) divided by the square root of 1.01, so almost right onto zero.
That's exactly the method this thread is about :-)


Title: Re: Actual 3D newton fractals
Post by: Pauldelbrot on January 22, 2013, 01:04:53 AM
Is it? Then there's a few extra absolute bars in your OP. :)