Simple circle circle collision detection

In summary, the conversation is about detecting and resolving collisions between two moving circles. The main issue is that the collision is detected after one circle has already penetrated the other, so they need to be moved back to just touching each other. The solution involves rotating the circles to the x-axis and performing calculations before rotating them back.
  • #1
kfour31
3
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
  • #2
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?
 
  • #3
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
 
  • #4
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.
 
  • #5
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:
  • #6
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
 
  • #7
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.
 

1. How does simple circle circle collision detection work?

Simple circle circle collision detection works by determining if the distance between the centers of two circles is less than the sum of their radii. If the distance is less than the sum of the radii, then the circles are considered to be colliding.

2. What are the limitations of simple circle circle collision detection?

Simple circle circle collision detection is limited to detecting collisions between circular objects. It also assumes that the circles are perfect and do not have any irregularities or holes.

3. How accurate is simple circle circle collision detection?

The accuracy of simple circle circle collision detection depends on the size and position of the circles being checked. If the circles are small and close together, the detection will be more accurate. However, if the circles are large and far apart, the detection may not be as precise.

4. Can simple circle circle collision detection be used for complex shapes?

No, simple circle circle collision detection is not suitable for complex shapes. It can only be used for circular objects. For complex shapes, more advanced collision detection algorithms are needed.

5. How can I optimize simple circle circle collision detection?

To optimize simple circle circle collision detection, you can use the squared distance between the centers of the circles instead of calculating the actual distance. This can improve performance and reduce the number of calculations needed. Additionally, you can also sort the circles based on their position to minimize the number of checks needed.

Similar threads

Replies
2
Views
147
Replies
1
Views
2K
Replies
9
Views
696
Replies
4
Views
676
  • General Math
Replies
3
Views
805
  • General Math
Replies
3
Views
2K
Replies
2
Views
1K
Replies
2
Views
1K
Replies
1
Views
1K
Replies
1
Views
733
Back
Top