Chaos Visualizer
This visualizer interprets the sequence entries as instructions for a "herd" of h ≥ 1 walkers traversing the vicinity of the vertices of a regular p-gon, and displays the locations that the walkers visit.
More precisely, each walker begins in the centre of the polygon. As it receives each sequence entry a ₙ, it interprets that entry as a polygon corner (typically by taking it modulo p, but a customizable formula may optionally be specified). It then walks a configurable proportion of the distance from its current location to that corner (typically halfway). It paints a dot in its new location, and repeats using the next sequence entry, etc.
It is also possible to configure a more complex formula for the step the walker takes, not just along a straight line toward the corner. This makes the visualizer capable of drawing an arbitrary iterated function system on the plane.
When this process is performed with a random sequence, this has been called the 'chaos game.' The chaos game on a square produces a uniformly coloured square, but on other shapes it produces fractal images. For example, on a triangle, one obtains the Sierpiński gasket in the limit.
For non-random sequences, the distribution of dots can reveal information about local correlations and overall distribution of the sequence values.
Parameters
- Number of corners: (of the polygon). There must be at least two.
If there are p corners, then they are numbered 0, 1,
2, ..., p - 1. These numberings are used in the
candCvariables when referencing a corner. - Number of walkers: Each walker has its own independent location
and heading. If there are h walkers, then they are numbered 0, 1,
2, ..., h - 1. These numberings are used in the
wandWvariables when referencing a walker. - Background color: The color of the visualizer canvas.
- Static mode: When checked, turns off zoom/pan and removes the iteration limit, allowing for more performant images.
- Walker formula: An expression that determines which walker to move for the current entry of the sequence being visualized. Non-integer values are reduced to the nearest smaller integer. The result is interpreted as the number of a walker, and no walker is moved at all if there is no such walker. For example, a formula value of 5.7 will move the walker numbered 5, and if there are fewer than 6 walkers, none will move.
The formula can use the following pre-defined variables:
n The index of the entry in the sequence being visualized.
a The value of the entry.
k The serial number of the step, starting from one for the first dot.
m The minimum index of the sequence being visualized.
M The Maximum index of the sequence being visualized.
p The number of corners.
w The number of the prior walker to take a step.
h The number of walkers.
f The frame number of the drawing pass in which this step occurs.
Note that the above definitions mean that n, k, and m are related by
n = m + k - 1. The maximum index M value may be Infinity for sequences
that are defined and can be calculated (in principle) for any index. The
frame variable f can be used to colour dots differently as time progresses.
You may also use the symbol A as a function symbol in this formula, and it
will provide access to the value of the sequence being visualized for any
index. For example, the formula A(n+1) - A(n) or equivalently A(n+1) - a
would produce the so-called "first differences" of the sequence.
-
Corner formula: An expression that determines which corner the current walker should step toward. (Non-integer values are handled as with the Walker formula, and again, if there is no such corner, the walker does not move at all.)
-
Eagerness formula: An expression that specifies what fraction of the distance toward the chosen corner the chosen walker will walk.
Besides the previous variables, this formula may also use:
C The corner number we are about to step toward
- Step formula: An expression that computes the new coordinates of the walker resulting from its current step of the specified portion of the distance to its chosen corner.
Besides the previous variables, this formula may also use:
g The eagerness with which we are stepping,
-
Size formula: An expression that specifies the radius of the dot that will be drawn at the new location of the walker (after executing the current step). The sign of the radius is ignored, but a zero radius will result in no dot being drawn.
-
Color formula: An expression that determines the color of the dot that will be drawn at the new location of the current walker, after it takes its step. Variables are as for the Size Formula. For details on how formulas may create and manipulate colors, see the Chroma documentation.
- Color chooser: This color picker does not directly control the display. Instead, whenever you select a color with it, the corresponding color string is inserted in the Color formula box.
- Dots to draw per frame: How fast the visualization fills in the dots.
- Fade rate: How fast old dots fade away, as a number between 0 and 1, with 0 corresponding to no fade and 1 to all older dots disappearing every frame. This effect is reset whenever you move or zoom the canvas. Warning: a large value can create a stroboscopic effect.
- Show corner labels: If checked, labels the corners of the polygon.
Controls
Unless Static mode is turned on, you may click and drag to pan the view, and use the scroll wheel to zoom in and out.
