Skip to main content

Checks if two rectangles intersect

# Tested with:
# Python 3.9.13
# Windows 10

from rect_intersection import intersects

# Allowed formats for box1/box2 
format_1x4 = (0, 0, 100, 200)
format_4x2 = [(0, 0), (100, 0), (100, 200), (0, 200)]
format_2x2 = [(0, 0), (100, 200)]

box1 = (0, 0, 100, 200)


box2 = (1000, 1000, 2000, 2000)
print(intersects(box1, box2))
box2 = (50, 20, 2000, 2000)
print(intersects(box1, box2))
box2 = [(50, 20), (2000, 20), (2000, 2000), (50, 2000)]
print(intersects(box1, box2))
box2 = [(50, 20), (2000, 2000)]
print(intersects(box1, box2))


box2 = (1000, 1000, 2000, 2000)
print(intersects(box1, box2))
box2 = (50, 20, 2000, 2000)
print(intersects(box1, box2))
box2 = [(50, 20), (2000, 20), (2000, 2000), (50, 2000)]
print(intersects(box1, box2))
box2 = [(50, 20), (2000, 2000)]
print(intersects(box1, box2))

box2 = (1000, 1000, 2000, 2000)
print(intersects(box1, box2))
box2 = (50, 20, 2000, 2000)
print(intersects(box1, box2))
box2 = [(50, 20), (2000, 20), (2000, 2000), (50, 2000)]
print(intersects(box1, box2))
box2 = [(50, 20), (2000, 2000)]
print(intersects(box1, box2))



False
True
True
True
False
True
True
True
False
True
True
True

	

Metadata

Release files for rect-intersection 0.10

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rect-intersection 0.10
File Size Uploaded Provenance Actions
rect_intersection-0.10.tar.gz 3.2 kB Without provenance Details for rect_intersection-0.10.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for rect-intersection 0.10
File Interpreter ABI Platform Actions
rect_intersection-0.10-py3-none-any.whl Python 3 none any Details for rect_intersection-0.10-py3-none-any.whl

Total release size: 7.7 kB

Release files / rect_intersection-0.10.tar.gz

Download URL rect_intersection-0.10.tar.gz
Size 3.2 kB
Tags Source
SHA-256 checksum
How to use checksums
c16628c24ad12c9e2a407a5f96ce8ff28279770cd844141b8b5f21bb9d84b8e8
BLAKE2b-256 checksum
How to use checksums
37906ad4b48b463375fe1bb41454884f3711b3b2908a14ca30cb04fbd7747cbf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Release files / rect_intersection-0.10-py3-none-any.whl

Download URL rect_intersection-0.10-py3-none-any.whl
Size 4.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
89cda676d5f8afa1367450653c2bc28c3ac30c8ca40001971ddcdc9238c8550f
BLAKE2b-256 checksum
How to use checksums
209714817a24a175c237a41c1a1d7fa493e625e55535a7d8629bff7f74ac10a3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Security for rect-intersection 0.10

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.10 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page