Velocity verlet integration for simulating elastic and inelastic collision with balls
Try it out! https://vaniljbulle.github.io/JustAnotherVerletPhysicsSimulation/
Sources used:
https://en.wikipedia.org/wiki/Elastic_collision
https://en.wikipedia.org/wiki/Verlet_integration
https://www.physicsclassroom.com/class/momentum/Lesson-1/Momentum-and-Impulse-Connection
http://hyperphysics.phy-astr.gsu.edu/hbase/colsta.html#c3