필터 지우기
필터 지우기

Returning True if the Line Intersects with Any Rectangle

조회 수: 4 (최근 30일)
Erkin Karatas
Erkin Karatas 2019년 12월 27일
답변: Walter Roberson 2019년 12월 27일
Hi all, I have a rectangles shown as below and also the code is attached. I want to return true if any line crosses any rectangle. The coordinates of the lines do not matter, you can guess them, if you want to try.
2019-12-27_23-59-15.png
thanks

답변 (1개)

Walter Roberson
Walter Roberson 2019년 12월 27일
"The intersection of groups of curves (e.g. contour lines, multiply connected regions etc) can also be computed by separating them with a column of NaNs"
So construct entries describing all of your rectangles together, separated by NaN, and then you can ask for the intersection of your line(s) with that.

카테고리

Help CenterFile Exchange에서 NaNs에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by