Welcome to Fractal Forums

Fractal Art => Images Showcase (Rate My Fractal) => Topic started by: Fractal Ken on June 21, 2013, 06:19:00 PM




Title: Sad Elephant
Post by: Fractal Ken on June 21, 2013, 06:19:00 PM
(https://s3.amazonaws.com/fractal_images/SadElephant1024.jpg)

Strange attractor
xn+1 = sin(1.52xn - 2.55) + sin(-2.70yn - 1.43)
yn+1 = sin(1.77xn + 2.82) + sin(1.58yn + 2.35)


Title: Re: Sad Elephant
Post by: Kali on June 22, 2013, 07:38:06 PM
Superb render, Ken! Love the colors... Right now I'm playing with volumetric 3D renders, if you could translate your formula to 3D and give some hints on the code I could try to implement it using GLSL. I'd love to see a rotating 3D version of this.


Title: Re: Sad Elephant
Post by: Fractal Ken on June 23, 2013, 12:31:33 AM
Thanks, Kali! I love these attractors; they're like IFS fractals with only one transformation. I think a 3D generalization would be very feasible and look great. In case you're unaware, the old Chaoscope (http://www.chaoscope.org/) program generates 3D strange attractors, though I know almost nothing about it.

Let me talk about the 2D case first. I got the idea of looking at strange attractors from this post (http://www.fractalforums.com/images-showcase-%28rate-my-fractal%29/attractor-no-20/) by element90. He's apparently implemented them (in a nonstandard way) in his software Saturn and Titan. I've been exploring the following generalization of Peter de Jong attractors (http://paulbourke.net/fractals/peterdejong/):

xn+1 = sin(axn + b) + sin(cyn + d)
yn+1 = sin(exn + f) + sin(gyn + h)

a, b, c, d, e, f, g, and h are constants between -PI and PI. The initial conditions are x0 = 0 and y0 = 0, though I highly doubt it matters. I iterate the formulas billions of times (probably overkill) and count the number of times each pixel gets hit, with a coloring nuance I'll explain later. Note that the orbit is entirely within a square centered at the origin with side length 4.

How do I choose the 8 constants? I have a program which repeatedly generates random constants, saves them to a file, and creates the corresponding thumbnail-size image. I look at a bunch of thumbnails and pick one I like. (I'd say about a third of them show chaotic behavior).

How do I color the image? I'll use this particular picture as an example. Each time the orbit lands on a pixel, I increase the green counter by 1, the red counter by |xn+1 - xn| (the horizontal distance of the last hop), and the blue counter by |yn+1 - yn| (the vertical distance of the last hop). There are certainly other possibilities involving distances and angles. It's probably unnecessary, but I do sort each counter and use the ranks to ensure an even color distribution.

For the 3D case the direct generalization of the recurrence relations is

xn+1 = sin(axn + b) + sin(cyn + d) + sin(ezn + f)
yn+1 = sin(gxn + h) + sin(iyn + j) + sin(kzn + m)
zn+1 = sin(pxn + q) + sin(ryn + s) + sin(tzn + u)

There are 18 constants; I skipped some letters to avoid typographical or notational confusion. I don't know whether picking good constant values by generating a lot of random thumbnails is easy in 3D. If not, perhaps examining a less general set of formulas is worthwhile. Please let me know if you want me to look at this issue. One thing is certain: The attractor will live in a cube centered at the origin with side length 6.

I think the 3D generalization is otherwise straightforward. For coloring, I'd probably try incrementing counters by |xn+1 - xn|, |yn+1 - yn|, and |zn+1 - zn|.

Good luck --- I bet the 3D renders will be spectacular.


Title: Re: Sad Elephant
Post by: C.K. on June 23, 2013, 07:37:32 PM
Woah, that's pretty incredible o_O.  I especially like how you decided to apply the colors, very vivid.  Very clean too.