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 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 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:
x
n+1 = sin(ax
n + b) + sin(cy
n + d)
y
n+1 = sin(ex
n + f) + sin(gy
n + h)
a, b, c, d, e, f, g, and h are constants between -PI and PI. The initial conditions are x
0 = 0 and y
0 = 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 |x
n+1 - x
n| (the horizontal distance of the last hop), and the blue counter by |y
n+1 - y
n| (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
x
n+1 = sin(ax
n + b) + sin(cy
n + d) + sin(ez
n + f)
y
n+1 = sin(gx
n + h) + sin(iy
n + j) + sin(kz
n + m)
z
n+1 = sin(px
n + q) + sin(ry
n + s) + sin(tz
n + 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 |x
n+1 - x
n|, |y
n+1 - y
n|, and |z
n+1 - z
n|.
Good luck --- I bet the 3D renders will be spectacular.