Hello all! I’m trying to write a java program that, as simply as possible, simulates Brownian motion. In essence, there will be a bunch of circles with different velocity and mass, and I need to know what happens when they hit each other. Detecting the collision is simple, since they are all circles and you can just use the distance formula to see if they’re touching, but as for exactly what they do once they touch, I’m somewhat lost.
I know this has been done before, but I can’t find any code for it. Also, I’d like to avoid using a clunky physics library, as there could be hundreds or circles at once and I’d like to keep the program running smoothly.
Thank you!