Updated
spiral
A number spiral you shape with sliders and a formula.
What it is
Dots are laid out along a spiral, one per integer, and colored by whether their number is prime, even or odd. Sliders set the starting distance, the spacing, how each dot grows and how many are drawn (up to 5,000), and a text field takes a formula for the angle between one dot and the next.
Nudge the angle and the dots regroup into arms, rings and moiré patterns.
How it works
- Each dot sits at a polar position: its distance grows with its index, and its angle adds one increment per step.
- The angle increment can be a formula, evaluated for every dot with
i,piandMathavailable. If the formula does not parse, it falls back to the slider value. - Trial division decides which dots get the prime color; the rest are even or odd.
- The spiral is plain SVG circles, re-rendered by React on every change. The formula field is throttled and the color pickers are debounced.
Built with
Started