Re: [转载] 有什么算法可以确定一个点在不在多边形内?# Computation - 科学计算
c*t
1 楼
【 以下文字转载自 EE 讨论区 】
【 原文由 cmmiut 所发表 】
draw a half-line towards right.
Count the total number of intersections bwteen the half-line and the polygon.
If the number is even, outside. If odd, inside.
Problem may arise if there are degenerate cases (2D is easy to handle,
3D will be much harder). A technique called SOS (simulation of simplicity)
gives an easy solution.
【 原文由 cmmiut 所发表 】
draw a half-line towards right.
Count the total number of intersections bwteen the half-line and the polygon.
If the number is even, outside. If odd, inside.
Problem may arise if there are degenerate cases (2D is easy to handle,
3D will be much harder). A technique called SOS (simulation of simplicity)
gives an easy solution.