# Collision Math for 2d Objects

## Recommended Posts

Zaph-0    128
Hi, I am trying to find out when the path of 2 objects interesect (when they collide) which one to slow down and which one to speed up so that they don't overlap and came up with the following approach: For that I have to know which one of the objects is "ahead" of the other one. In my example the distance for the red object is greater than the blue object so the red one is ahead of the blue one. Problem is I am not certain if that still applies when the radius of one object is greater than the radius of the other one or if there is some fundamental flaw to my idea. I have no experience with this kind of stuff and this is just a wild guess but I hope this is the right approach to this situation. Does anyone have some experience with this ?

##### Share on other sites
Alrecenk    400
This is known as a swept circle-circle collision. The basic idea is to take two parametric paths with respect to time and create an equation for when the paths are r1+r2 apart. Googling swept circle collision will probably get you what you want, if for each step your assuming your circles are moving in a line. If they are moving in more complicated paths it gets harder.