Functions
Reusable functions for Synesthesia.
Tracks the previous frame's click position so you can compute a per-frame drag delta — the basis for orbit-camera and paint-style mouse interaction in a .synScene.
Domain repetition clamped to a [lima, limb) range instead of tiling forever, for repeated SDF patterns that stop at scene bounds.
Round-trip between cartesian and polar (angle, radius) coordinates — the inverse-included counterpart to the built-in _toPolar.
2D rotation matrix. Returns a mat2 so you can rotate a coordinate plane in place with p.xy *= rot(a), rather than transforming a point like _rotate does.
Gives each time-driven effect a large random seed offset so multiple noise channels don't visibly sync up or spike together.
In-place mix() wrappers that nudge a value toward a target without restating its name every line.
Approximate float equality, comparing computed values without exact-match fragility.