

A Retina-ready version of the deJong Attractor - jashkenas
http://jashkenas.s3.amazonaws.com/misc/deJong/deJong.html

======
stianan
Could someone explain what an attractor is? I looked it up on Wikipedia, but I
don't understand how these shapes benefit from the definition given there.

~~~
jashkenas
The Wikipedia explanation is a fine one. To simplify -- it's when you observe
a variable moving through through a space. In programming this means taking a
coordinate or set of coordinates, and repeatedly feeding it into a function
that will move the coordinates to a new location.

In this case, the heart of the function is:

    
    
        x = ((sin(xSeed * y) - cos(ySeed * x)) * width * 0.2) + width / 2
    

... and the same for "y".

([http://jashkenas.s3.amazonaws.com/misc/deJong/docs/deJong.ht...](http://jashkenas.s3.amazonaws.com/misc/deJong/docs/deJong.html#section-23))

In our attractor, every time the coordinate pair lands on a new spot, that
spot is exposed to a little bit of light.

What you can do for "x" and "y", you can also do for "z". If you generalize
the deJong attractor into 3 dimensions, it looks like this:

<https://www.youtube.com/watch?v=PrXe4RwtZpQ>

~~~
elteto
Could you explain why is it significant that points seem to cluster around
some specific trajectories / coordinates?

~~~
pygy_
Actually, the attractor in a dynamic system is the equivalent of an asymptote
in a standard function.

Since the points cluster around it, it is revealed by plotting the values of
the system.

~~~
stianan
It would be interesting to read the proof that de Jong's function has an
attractor. Do you know where I could find it?

------
jashkenas
This is a repost (the Retina bit is new), but for those who haven't seen it
before, you can share particular initial seeds by clicking on the "Permalink"
button.

An example Retina seed:
[http://jashkenas.s3.amazonaws.com/misc/deJong/deJong.html#52...](http://jashkenas.s3.amazonaws.com/misc/deJong/deJong.html#521,449)

Annotated source here:
[http://jashkenas.s3.amazonaws.com/misc/deJong/docs/deJong.ht...](http://jashkenas.s3.amazonaws.com/misc/deJong/docs/deJong.html)

One interesting question will be if anyone finds a single seed that works well
for both regular and Retina versions.

------
mvr_
The best thing about this toy is that, no matter where you click, you get a
beautiful result.

The only thing missing is arrowkey controls to bump around a pixel at a time,
so you can better explore an interesting region of the space you've found.

------
Jacob4u2
I noticed that dragging around causes the graph to change. I know I should
just look at the source, but can someone tell me what inputs the dragging
changes for the computation? Also, bonus points for some cool drags I can do
that you notice.

~~~
jashkenas
This is the bit that records the dragging change in mouse position:

[http://jashkenas.s3.amazonaws.com/misc/deJong/docs/deJong.ht...](http://jashkenas.s3.amazonaws.com/misc/deJong/docs/deJong.html#section-16)

This is the bit that seeds the sketch at the last recorded mouse position:

[http://jashkenas.s3.amazonaws.com/misc/deJong/docs/deJong.ht...](http://jashkenas.s3.amazonaws.com/misc/deJong/docs/deJong.html#section-22)

------
samstokes
FWIW, in Firefox (15) I just see a white square. Works fine in Chrome.

------
jlong_gt
what is this?!

