Point or multiple points is/are in a triangle??
4 views (last 30 days)
Show older comments
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 Comment
Star Strider
on 8 Dec 2020
Consider the triangle a polygon.
Search for functions that will give you the result you want with polygons.
Accepted Answer
Bruno Luong
on 8 Dec 2020
tf = inpolygon(Points(:,1),Points(:,2),Triangle(:,1),Triangle(:,2))
0 Comments
More Answers (1)
Ze-Zheng Wu
on 8 Dec 2020
Edited: Ze-Zheng Wu
on 8 Dec 2020
isinterior(polyshape(Triangle), Points);
0 Comments
See Also
Categories
Find more on Elementary Polygons in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!