Intersection line and quadrilateral
Mostrar comentarios más antiguos
Hi everyone, I found something about this, but nothing as simplified as I'm looking for.
I have a line expressed with a series of x and y coordinates
x_l = [0 1 5 4 8];
y_l = [1 4 2 2 3];
and a quadrilateral area identified with the coordinates of its 4 angular nodes in counterclockwise order (it should be a generical quadrilateral, but I can assume it's a square if it's too articulated):
% ex: square
A_x = [3 4 4 3];
A_y = [2 2 3 3];
I need to verify if the line intersect the area... Just to verify, not to find the intersection.
I've found some methods online, but all of them are exaggerated and heavy for my purposes ("polyxpoly" for example); I have many squares and many lines to be processed and i just need a true or false flag in the fastest way possible. Maybe it's super simple, or maybe not, but nothing comes to my mind!
Thanks to anyone who wants to help me!
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre 2-D and 3-D Plots en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!