c****t 发帖数: 36 | 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. |
|