Find if points are within a circle with given center and radius

后端 未结 5 1417
别那么骄傲
别那么骄傲 2021-02-06 12:32

We have a point (x,y) and a set of some other points (xi,yi). How can we determine which of (xi,yi) are within a circle with c

5条回答
  •  既然无缘
    2021-02-06 13:27

    If (xi - x)^2 + (yi - y)^2 is less than d^2, it's inside. If it equals d^2, it's on the circle. If it's greater than d^2, it's outside.

提交回复
热议问题