How do I detect intersections between a circle and any other circle in the same plane?

前端 未结 7 2256
走了就别回头了
走了就别回头了 2020-11-28 05:54

I\'m looking for an algorithm to detect if a circle intersects with any other circle in the same plane (given that there can be more than one circle in a plane).

One

7条回答
  •  伪装坚强ぢ
    2020-11-28 06:11

    If the distance between the centers of two circles is at most the sum of their radii, but at least the absolute value of the difference between the radii, then the circles themselves intersect at some point.

    The "at least the difference" part applies if you care only about the circles themselves, and not their inner areas. If you care whether the circles or the areas they enclose share any points -- that is, if one circle totally inside the other counts as "intersecting" to you -- then you can drop the "at least the difference" check.

提交回复
热议问题