Point or multiple points is/are in a triangle??

조회 수: 7 (최근 30일)
Kriti
Kriti 2020년 12월 8일
답변: Bruno Luong 2020년 12월 8일
Check whether a point or multiple points is/are in a triangle with three corners
Points = [x, y];
Triangle = [x1, y1; x2, y2; x3, y3]
Return true or false for each point tested.
  댓글 수: 1
Star Strider
Star Strider 2020년 12월 8일
Consider the triangle a polygon.
Search for functions that will give you the result you want with polygons.

댓글을 달려면 로그인하십시오.

채택된 답변

Bruno Luong
Bruno Luong 2020년 12월 8일
tf = inpolygon(Points(:,1),Points(:,2),Triangle(:,1),Triangle(:,2))

추가 답변 (1개)

Zezheng Wu
Zezheng Wu 2020년 12월 8일
편집: Zezheng Wu 2020년 12월 8일
isinterior(polyshape(Triangle), Points);
see polyshape and isinterior for more information.

카테고리

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