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

前端 未结 5 921
北荒
北荒 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:12

    I think this article gives a clear O(log n) solution. Find the extremes in the direction perpendicular to the given line.

提交回复
热议问题