# 2d Circle different ARC's Collision detection

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

## 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 ?

##### 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.).

##### Share on other sites

If you got the local closest point on the circle, just use arctan2 to get the angle for that point.

Secondly bring that angle into range 0 - 2*PI (google: normalize angle radians)

Detect region/arc from that normalized angle. Done.

##### Share on other sites

@Finalspace
mind to give some example ? i didn't understand much from your saying

##### 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.

1. 1
2. 2
Rutin
15
3. 3
4. 4
5. 5

• 13
• 26
• 10
• 11
• 9
• ### Forum Statistics

• Total Topics
633725
• Total Posts
3013559
×