필터 지우기
필터 지우기

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

답변 (1개)

KSSV
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
Ammar
Ammar 2017년 1월 11일
Dear KSSV, I would like to thank you for this answer. Please, what about the function "boundary()" how it is work ? Kind regards Ammar
KSSV
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 CenterFile Exchange에서 Elementary Polygons에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by