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

5 visualizaciones (últimos 30 días)
Kriti
Kriti el 8 de Dic. de 2020
Respondida: Bruno Luong el 8 de Dic. de 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 comentario
Star Strider
Star Strider el 8 de Dic. de 2020
Consider the triangle a polygon.
Search for functions that will give you the result you want with polygons.

Iniciar sesión para comentar.

Respuesta aceptada

Bruno Luong
Bruno Luong el 8 de Dic. de 2020
tf = inpolygon(Points(:,1),Points(:,2),Triangle(:,1),Triangle(:,2))

Más respuestas (1)

Zezheng Wu
Zezheng Wu el 8 de Dic. de 2020
Editada: Zezheng Wu el 8 de Dic. de 2020
isinterior(polyshape(Triangle), Points);
see polyshape and isinterior for more information.

Categorías

Más información sobre Elementary Polygons en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by