Distance from a point to a polygon

后端 未结 5 1048
花落未央
花落未央 2020-12-02 13:42

I am trying to determine the distance from a point to a polygon in 2D space. The point can be inside or outside the polygon; The polygon can be convex or concave.

If

5条回答
  •  感情败类
    2020-12-02 14:09

    I do not know about the difference in performance with respect to the rest of answers, but in boost C++ libraries there is an generic implementation called distance. It has information about complexity in every case and in your problem case it is linear.

    I was also looking for solutions to this problem some days ago and I want to share this finding. Hope it helps to someone.

提交回复
热议问题