역량강화/CAD
2D 사각형 간의 간섭 체크 하는 방법
미니언즈 닮은 개발자
2022. 12. 19. 20:40
1. 소스 코드
bool isOverlapped = false;
if (RectA.X1 < RectB.X2 && RectA.X2 > RectB.X1 && RectA.Y1 > RectB.Y2 && RectA.Y2 < RectB.Y1)
isOverlapped = true;
https://stackoverflow.com/questions/306316/determine-if-two-rectangles-overlap-each-other
Determine if two rectangles overlap each other?
I am trying to write a C++ program that takes the following inputs from the user to construct rectangles (between 2 and 5): height, width, x-pos, y-pos. All of these rectangles will exist parallel ...
stackoverflow.com
2. 참조 그림
https://silentmatt.com/rectangle-intersection/
Silent Matt
Thoughts, stories and ideas.
silentmatt.com