avatar
面试问题求解# JobHunting - 待字闺中
w*0
1
Given a triangle and a point, how do you tell if the point is inside the
triangle
or outside? Extend this for a irregular polygon
avatar
c*2
2
随机选个方向过这点做射线,计算射线于polygon的多少条边相交,奇数在里面偶数在
外面。注意不能是polygon的顶点,否则另选射线,因为随机性,过顶点的概率几乎是0

【在 w****0 的大作中提到】
: Given a triangle and a point, how do you tell if the point is inside the
: triangle
: or outside? Extend this for a irregular polygon

avatar
h*e
3
好多种算法,楼主找本计算几何的书看看。因为很多corner case在这里说不清的。
相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。