2022-01-09
I have finally finished reading the excellent Eloquent JavaScript, and some of the exercises were fun enough that I don’t want them to just collect dust in GitHub.
First up: mouse trails! This was in the chapter about event handling.
The program (see source, or GitHub)
models two masses attached to the mouse cursor with (invisible) springs;
c
is the damping coefficient.