Dear all, please, I am looking to understand how the two functions ("inpolygon ()" and "boundary()") work ?
2 次查看(过去 30 天)
显示 更早的评论
Dear all, Please, I have a question: I know the function "inpolygon()" give me a logical result if a data point inside or outside a polygon and "boundary()" give me the data points on the border of a shape. But how these two algorithms work ?
Please, I need to understand them.
Kind regards Ammar
0 个评论
回答(1 个)
KSSV
2017-1-11
From a given point P, the code draws a straight onto the given polygon. If this line intersects even number of times then the point lies outside the polygon, if the line intersects odd number points then points lies inside the polygon. The code is based on the refer article:
For outline refer:
2 个评论
KSSV
2017-1-12
It uses convexhull I guess....you can see the inbuilt function. Type edit boundary and read the code part and documentation given out there.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Elementary Polygons 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!