Ball physics in 2d to simulate gas particles behaviour. This is implemented in vanilla javascript using the canvas to create the visualization. It is fairly simple and easy to understand the code. Gravity works fine just when the particles have little to no movement, they intersect and stop colliding, this is being worked on.
https://spicyyoghurt.com/tutorials/html5-javascript-game-development/collision-detection-physics