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

3 ビュー (過去 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 件)

Ze-Zheng Wu
Ze-Zheng Wu 2020 年 12 月 8 日
編集済み: Ze-Zheng Wu 2020 年 12 月 8 日
isinterior(polyshape(Triangle), Points);
see polyshape and isinterior for more information.

カテゴリ

Help Center および File ExchangeElementary Polygons についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by