# Calculating collisions in realtime - dealing with a delay in time [closed]

I wasn't sure in which stackexchange to post this, since the questions deals with a lot of different topics. I've posted it first at stackoverflow, but I've been redirected here...

Suppose:

• You're coding a program in which 10 circles move around on the screen in realtime, all with a different velocity, that can change at certain times due to physics-calculations.

• The calculations can only be calculated on every frame

• Each frame, you have to make sure the circles who "collide"/"have collided during the time between this frame and the last" with eachother will 'bounce off' by using physics-calculations

• During the time between frame x and frame x+1, three circles will collide with eachother. However, during frame x none of the circles touches the other. In frame x+1, the same thing applies (none collides) I will try to better illustrate this with an image with my epic paint skills:

http://imageshack.us/photo/my-images/854/collisionproblem.jpg/

The question:

What are good ways to keep track of collision like this, so that a collision wouldn't get skipped due to some (unexpected) large delay in time between two frames?

This question has been spooking around in my head for way too long...

-

## closed as off topic by David Z♦Dec 20 '11 at 0:09

Questions on Physics Stack Exchange are expected to relate to physics within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

Hi xcrypt, and welcome to Physics Stack Exchange! Sorry to be giving you the runaround, but I believe this is off topic here, since the question you're asking about is computational, not physical, in nature. See meta.physics.stackexchange.com/questions/43/… for example. I'll ask around and help you figure out where the best place to ask this is. (Did you post the question on SO? If so, could you link to it?) – David Z Dec 20 '11 at 0:09
@DavidZaslavsky Yes I did, however I deleted it, since people told me it wasn't a good place to post it and redirected me here... – xcrypt Dec 20 '11 at 0:14
@DavidZaslavsky Could you tell me what stackexchange is a good place to post this? I really want to know the answer :) – xcrypt Dec 20 '11 at 0:22
Patience, xcrypt - as I said in my last comment, I will confer with others and try to find a good place for this question. Just sit tight for a little while. – David Z Dec 20 '11 at 0:26
OK, the consensus is that your question is appropriate on Stack Overflow. We've undeleted your original post, so you can go back to SO and seek answers there. – David Z Dec 20 '11 at 0:42