Simple circle circle collision detection

AI Thread Summary
The discussion focuses on detecting and resolving the penetration of two moving circles during collision detection. The user is trying to determine how far the circles overlap and then adjust their positions to ensure they only touch without overlapping. There is a challenge when the circles move quickly, causing them to skip frames and penetrate each other before a collision is detected. Suggestions include rotating one circle around the other to simplify calculations and then adjusting their positions accordingly. The conversation emphasizes the need for clarity in the physics and math involved in resolving circle collisions effectively.
kfour31
Messages
3
Reaction score
0
hi all,
I am testing the collision detection between two circle using classic the distance < sumRadius.

now i need help to detect the penetration of circles and to resolve the penetration before

collision reaction
 
Mathematics news on Phys.org
Can you be clearer about what you are asking? Seems that you are trying to detect whether two circles are overlapping and how far they overlap. Do you have a physics-related question? A math question?
 
ya i need to detect
1. how far they are overlapping
2. and need to pull back the circles to the correct position(ie just touching each other, need to avoid overlap)

thanx in advance
 
I'm still unclear as to what you need. (In your first post it sounded like you knew how to determine when two circles overlap.) When you say that you "need to detect" how far they overlap, what are you given? Is this a math question? I don't quite see the physics question yet.
 
Is this a matter of find the point where two circles of different radii (diameters) are tangent? If this is like a scattering problem, then one input would be the impact parameter which is the shortest distance between the parallel lines passing between the centers of the circles. Those lines would also be parallel to the velocity of the circle which is approaching the other.
 
Last edited:
thanks for showing interest,

Let me explain, i am detecting collision between two moving circles, i know their X,Y, and radius.
so in each frame i am checking this condition
distance_between_circles <= sum_of_their_radii then collision occurs,

when the circles are moving really fast enough, it skips frames and the collision is detected after one circles penetrates half the other,

so at the time of collision i don't know which direction the ball came from and collided.

1.i need to move the circles so that they can just touch each other (not penetrated)

thats it
 
I'm no physicist but the problem isn't that hard to figure out. What you want to do is rotate one of the circles around the other circle by the angle between their two center points. Once you do that, they are then lying on the x axis. From there you can perform any calculations you want on them then when you're done, just rotate them back. If your using velocities, you'll have to rotate them too. It's easier to think of this problem in one dimension.

Hope this helps, and hope it's not too late.
 

Similar threads

Back
Top