raygeo.geo.shape.rect
Rectangle intersection and containment tests.
Provides functions to test whether two axis-aligned rectangles intersect and whether one rectangle fully contains another.
Functions
do_rects_intersect()
do_rects_intersect(r1: Rect, r2: Rect) -> bool
Check if two rectangles intersect.
Returns: True if the rectangles intersect.
| Parameter | Type | Description |
|---|---|---|
r1 | Rect | First rectangle (x_min, y_min, x_max, y_max). |
r2 | Rect | Second rectangle (x_min, y_min, x_max, y_max). |
| Returns | bool |
does_rect_contain_rect()
does_rect_contain_rect(outer: Rect, inner: Rect) -> bool
Check if one rectangle contains another.
Returns: True if outer fully contains inner.
| Parameter | Type | Description |
|---|---|---|
outer | Rect | Outer rectangle (x_min, y_min, x_max, y_max). |
inner | Rect | Inner rectangle (x_min, y_min, x_max, y_max). |
| Returns | bool |
does_rect_intersect_rect()
does_rect_intersect_rect(r1: Rect, r2: Rect) -> bool
Check if two rectangles intersect.
Returns: True if the rectangles intersect.
| Parameter | Type | Description |
|---|---|---|
r1 | Rect | First rectangle (x_min, y_min, x_max, y_max). |
r2 | Rect | Second rectangle (x_min, y_min, x_max, y_max). |
| Returns | bool |
is_point_inside_rect()
is_point_inside_rect(point: Point, rect: Rect) -> bool
Check if a point is inside a rectangle.
Returns: True if the point is inside the rectangle.
| Parameter | Type | Description |
|---|---|---|
point | Point | Point (x, y) to test. |
rect | Rect | Rectangle (x_min, y_min, x_max, y_max). |
| Returns | bool |