Particle physics collision simulator in JavaScript
A lightweight 2D particle collision simulator demonstrating elastic collisions with momentum and kinetic energy conservation.
Total momentum is conserved in all collisions:
For two particles
For elastic collisions:
Simply open index.html in a browser. Particles will spawn and collide automatically.
- ✅ Elastic collisions with momentum & energy conservation
- ✅ Wall bouncing with energy loss
- ✅ Variable mass & radius based on particle properties
- ✅ Beautiful trail effects with gradient coloring
- ✅ Real-time physics stats display
- ✅ Interactive controls (pause, speed, trails)
- ✅ Click to add particles
- ✅ Drag to attract particles
- Click - Add new particle at cursor
- Drag - Attract particles toward cursor
- Speed slider - Adjust simulation speed (0.1x - 3x)
- Pause - Freeze simulation
- Trails - Toggle particle trails
- Clear - Remove all particles
- Reset - Reset to initial state
MIT