Sign in to follow this  

2d Circle different ARC's Collision detection

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

The way to detect collision between 2 circles or circle and line . using trigonometry
But now i like be able to detect which part of the circle arcs im hitting , for example i divided my circle to 4 different sized arcs. i will like to know which ARC of the Circle is bean hit . 1 ,2 ,3, or 4 See image 
what is the best collision detection algorithm for this ? or how does it called ?F4fP5px.png

Share this post


Link to post
Share on other sites

If you know the point on the circle that is colliding with the other circle or the line, you can determine the angle between whatever direction the circle is "facing" (if the circle, and thus the individual arcs, can rotate around the center) and the collision point. The arcs can then just be thought of as angle-ranges (0 through PI/2, Pi/2 through 3Pi/2, etc.).

Edited by NoAdmiral

Share this post


Link to post
Share on other sites

Do you have the point of intersection worked out?

 

atan2 can give you the angle if you feed it the y,x position relative to the center of the circle. The angle it gives will consider zero degrees/radians to be pointing toward the right.

 

Each one of your arcs has a start angle and an end angle, so just look to see which range your angle is in.

Share this post


Link to post
Share on other sites

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

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this