Collision detection between a moving circle and stationary point

In summary, To find a collision between a moving circle and a stationary line segment, one can use the equation of a circle with the origin at the point (P) and a radius equal to that of the original circle. This equation can then be substituted for the y-value in the line of motion equation for the ball. After multiplying and simplifying, the resulting quadratic equation can be solved for the intercepts to determine the collision point. However, this method may not work if the circle has a velocity of 0 in the x direction.
  • #1
ZippyDee
11
0
I'm trying to figure out the best way to find a collision between a moving circle and a stationary line segment. I have the x and y of the point, and the x, y, radius, x velocity, and y velocity of the circle.

//Edit:
I tried using the equation of a circle with the origin at the point (P) and a radius equal to that of the original circle, and then solving that for x, substituting the equation for the line of motion of of the ball in place of y:

m=(ball.yVelocity)/(ball.xVelocity)
b=ball.y-ball.x*m
r2=((mx+b)-Py)2+(x-Px)2

I multiplied it all out and simplified it to standard form. Then I collected like terms and came up with these variables

A=m2+1;
B=2*m*b-2*m*Py-2*Px;
C=b2-2*b*Py+Py2+Px2;

Then I used the quadratic formula to find the intercepts

That should work, but it doesn't...
 
Last edited:
Mathematics news on Phys.org
  • #2
Wow...never mind, I am an idiot...I forgot to subtract r2 before collecting terms!
 
  • #3
Oh...but this doesn't work if the circle has an x velocity of 0...How do I deal with that?
 

1. How does collision detection between a moving circle and stationary point work?

The collision detection algorithm involves checking the distance between the center of the moving circle and the stationary point. If the distance is less than or equal to the radius of the circle, a collision is detected.

2. What is the purpose of collision detection in this scenario?

The purpose of collision detection is to determine if the moving circle has come into contact with the stationary point, which can be used to trigger a specific action or behavior in a game or simulation.

3. Can collision detection detect collisions between non-circular shapes?

In this specific scenario, the algorithm is designed for detecting collisions between a circle and a point. However, there are other collision detection algorithms that can be used for detecting collisions between non-circular shapes, such as polygons or rectangles.

4. How accurate is collision detection between a moving circle and stationary point?

The accuracy of collision detection depends on the implementation of the algorithm and the precision of the measurements used. In most cases, it is accurate enough for practical applications, but it may not be 100% precise.

5. Are there any limitations to collision detection between a moving circle and stationary point?

One limitation is that the algorithm is only designed for detecting collisions between a circle and a point. It may not work for detecting collisions between other shapes or for more complex scenarios. Additionally, the accuracy of the detection can be affected by factors such as the speed and size of the moving circle and the distance between the circle and the point.

Similar threads

Replies
2
Views
286
  • General Math
Replies
4
Views
814
  • General Math
Replies
6
Views
943
Replies
2
Views
817
Replies
1
Views
770
Replies
5
Views
2K
Replies
7
Views
3K
  • General Math
Replies
2
Views
1K
  • General Math
Replies
1
Views
1K
  • General Math
Replies
7
Views
2K
Back
Top