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

4 Ansichten (letzte 30 Tage)
Kriti
Kriti am 8 Dez. 2020
Beantwortet: Bruno Luong am 8 Dez. 2020
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 Kommentar
Star Strider
Star Strider am 8 Dez. 2020
Consider the triangle a polygon.
Search for functions that will give you the result you want with polygons.

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Bruno Luong
Bruno Luong am 8 Dez. 2020
tf = inpolygon(Points(:,1),Points(:,2),Triangle(:,1),Triangle(:,2))

Weitere Antworten (1)

Ze-Zheng Wu
Ze-Zheng Wu am 8 Dez. 2020
Bearbeitet: Ze-Zheng Wu am 8 Dez. 2020
isinterior(polyshape(Triangle), Points);
see polyshape and isinterior for more information.

Kategorien

Mehr zu Elementary Polygons finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by