Intersection line and quadrilateral
이전 댓글 표시
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!
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Sparse Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!