Comment

Comment by bourgoisloic

The springs are not damped yet, but for the main example, drag is enabled[1]. This continuously slows down the particles.

Drag is computed[2] for all the particles using something similar to the Drag equation[3].

Also, like electricslpnsld said, having a small enough time step helps.

[1] https://github.com/loicbourgois/gravitle/blob/master/fronten...

[2] https://github.com/loicbourgois/gravitle/blob/master/src/par...

[3] https://en.wikipedia.org/wiki/Drag_equation

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton