I wrote a C++ program to simulate the motion of N-identical particles moving in a circle. The particles can be initialized to move with any velocity and can also be intialized to start from any postion of the circle.
During the course of their motion, they can collide with other particles. You can specify whether the collision can be elastic, inelastic or perfectly inelastic by specifying the coefficient of restitution 'e'.
The code is well commented and easy to understand. The variables which can be modified according to different scenarios are:
- No. of particles
- Radius of the circle
- Coefficient of restitution
- Initial position of the particles
- Initial velocity of the particles
- No. of collisions you wish to observe
The variables are highlighted by a comment
//edit this
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.