SpacedArray

clock_util. SpacedArray

Helper class to construct an array where the lowest-valued indices are spaced the farthest from one another. Used to set the phases of the clocks such that the highest probability clocks have the most disparate phases.

For example, SpacedArray(5).arr = [0, 4, 2, 5, 1, 3]. Note that adjacent numbers (such as 0 and 1, 1 and 2, ...) are pretty far from each other.

The values 0, 4, 2, ... are the starting locations of each clock’s hour hands when there are 6 active clocks on the screen.

Constructor

new SpacedArray(nels)

Source:
Properties:
Name Type Description
arr Array.<number>

The 'spaced' array of length nels. For example, if we call SpacedArray(nels=5), then arr will equal [0, 4, 2, 5, 1, 3]

Parameters:
Name Type Description
nels number

The number of elements in the array. Equal to the number of unique hour hand phases (determined by rotation period and framerate).