|
You've probably seen screensavers like xswarm
.
In xswarm
, a wasp runs around the screen randomly.
A bunch of bees follow it. The bees don't have quite the turning
radius that the wasp has, so they flow nicely behind the wasp.
Now, ask yourself, would the wasp really fly around in two dimensions like that if it had a herd of bees after it? ``His pattern indicates two-dimensional thinking.''
The nklein software angle is: ``Of course! If you gave that wasp 144 dimensions, it'd make good use of them.''
This program allows a the wasp to wander around in a given number of dimensions followed by a given number of gnats (sorry, we chose ``gnats'' instead of ``bees''). The output of the program is a stream whose width is the number of dimensions. The value of the pixels on each line of the stream are directly correlated to the distance from the origin of the positive average coordinates.
What really goes on is this.... during each pass, the position of the wasp is updated and the positions of the gnats are updated. The wasp is trying to get to a particular point in n-space. Every so often, the wasp's target point changes.
After the positions are updated, the average position of
the wasp and all of the gnats is calculated. If the -abs
option was specified, the absolute value of these average
coordinates is taken. Each coordinate is multiplied by the gain
and then clipped to the range [0,255]
. Those
values are output as unsigned characters in order from lowest numbered
dimension to highest numbered dimension.
Here is some sample output from the swarm (rotated so that time increases from left to right):
32
.7
.30.0
.10.0
1.0
.1.5
.32.0
.10.0
.[0,255]
.