PureScript spirographs
summary
PureScript code generates spirographs on an HTML canvas using a purescript-drawing DSL and the PureScript behaviors library: time comes from a continuous seconds stream and animate is called ~60×/s to mark points. Geometry uses newtypes and derived instances to avoid boilerplate, trig to place pen offset, and simplifying the inner/outer diameter ratio yields the numerator as the number of revolutions used to compute the stop time. Animation works but renders dots (not continuous lines) on an old laptop; a 3D generalization breaks on JavaScript floating‑point/projection issues.
AI-written summary · about
chapters (8)
- 0:00Introduction
- 0:52What are spirographs
- 3:05Coordinates
- 8:30Drawing
- 12:47Animating
- 16:18Fun Questions
- 23:40Other Exercises
- 26:03Summary
related talks
32mStunning visuals with Maths and...no JavaScript?
34mZero to One: The Mystical Mathematics Of Creative Coding
30mHTML5 Canvas Animation with Javascript
22mGenerative Art Speedrun
27mBreaking Down JavaScript Complexities With Generative Art
45mNatural physics simulations and canvas hackery
33mDeep Space - A Simulation Drama
27mCreating natural simulations in a web browser
