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

3 次查看(过去 30 天)
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 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