Skip to content

Instantly share code, notes, and snippets.

View mikeskaug's full-sized avatar

Mike Skaug mikeskaug

View GitHub Profile
@pbeshai
pbeshai / .block
Last active December 17, 2019 13:56
Animate 100,000 points with regl - III
license: mit
height: 720
border: no
@vasturiano
vasturiano / README.md
Last active March 11, 2023 10:10
Entropy

Simulation of collision between moving particles with different masses inside a container, using the d3-force physics engine.

Uses two elastic collision forces, d3.forceBounce to handle elastic collisions between nodes, and d3.forceSurface for collisions with the container walls.

You can reduce the elasticity (coefficient of restitution) of the particles using the slider on the upper-left, causing kinetic energy to be lost at every collision. Elasticity of 1 indicates a pure elastic collision, while a value of 0 will cause particles to stick to each other along the collision axis.