Which formula for elastic collision?

86 Views Asked by At

When researching a bit about elastic collisions, I've been confused about how many different ways there are to do this. I've seen multiple methods, some of which are extremely complex (using sine and cosine) and some which are more simple.

For example, this StackOverflow answer provides a simple solution, while this tutplus article uses a more complex solution.

I'm trying to make a simple simulation which there are balls that bouncing around borders and other balls. What formula should I use and what are the differences between them?