# Circle-Point Collision Response

This topic is 2921 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi guys,

I have a 2D ball (circle) hitting a corner and I don't know how to reflect the ball as a response.

I think I should move the ball to the point of collision, then compute a normal and reflect off that but I can't figure out how to make the normal. Do I first make a vector from the center of the circle to the corner point, then make a perpendicular one to that and use it as the normal ? If that's the way how do I make sure the normal is facing the right way ?

Am I on the right track ?

##### Share on other sites
Quote:
 Original post by EndemoniadaDo I first make a vector from the center of the circle to the corner point, then make a perpendicular one to that and use it as the normal ?
Just the first part, more or less; the collision normal will be parallel to the vector from the corner point to the circle center (which direction you want it to point is up to you).

##### Share on other sites
Here's an image that might help. If the circle moves in the direction of u before the collision, then it should move in the direction of v after. In this image the normal is the center-point minus the corner point.

The following page also shows how to calculate it. They have the normal the other way, so the plus in the equation turns to a minus.
http://mathworld.wolfram.com/Reflection.html.

##### Share on other sites
Thanks a lot, that picture cleared everything up for me. I implemented it and it's working perfectly.

1. 1
Rutin
37
2. 2
3. 3
4. 4
5. 5

• 11
• 10
• 13
• 103
• 11
• ### Forum Statistics

• Total Topics
632975
• Total Posts
3009669
• ### Who's Online (See full list)

There are no registered users currently online

×