Asymptotically optimal algorithm to compute if a line intersects a convex polygon

前端 未结 5 923
北荒
北荒 2021-02-01 05:25

An O(n) algorithm to detect if a line intersects a convex polygon consists in checking if any edge of the polygon intersects the line, and look if the number of intersections is

5条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-01 06:21

    You just need to find a point A that is on the left side of the line and another point that is on the right side. The remaining question is how to find that points quickly.

提交回复
热议问题