Skip to main content

Calculate the intersection point of line segments in a two-dimensional plane.

Project description

segment_intersection_2d

Calculate the intersection point of line segments in a two-dimensional plane.

Install

pip install segment_intersection_2d

Usage

from segment_intersection_2d import segment_intersection_2d

line_1_p_1 = (0, 0)
line_1_p_2 = (1, 1)
line_2_p_1 = (1, 0)
line_2_p_2 = (0, 1)
crs = segment_intersection_2d(line_1_p_1, line_1_p_2, line_2_p_1, line_2_p_2)
print(crs) # (0.5, 0.5)

line_1_p_1 = (0, 1)
line_1_p_2 = (0, 0)
line_2_p_1 = (1, 1)
line_2_p_2 = (1, 0)
crs = segment_intersection_2d(line_1_p_1, line_1_p_2, line_2_p_1, line_2_p_2)
print(crs) # None

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

segment_intersection_2d-0.1.0.tar.gz (1.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

segment_intersection_2d-0.1.0-py3-none-any.whl (2.8 kB view details)

Uploaded Python 3

File details

Details for the file segment_intersection_2d-0.1.0.tar.gz.

File metadata

  • Download URL: segment_intersection_2d-0.1.0.tar.gz
  • Upload date:
  • Size: 1.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.1 CPython/3.11.15 Windows/10

File hashes

Hashes for segment_intersection_2d-0.1.0.tar.gz
Algorithm Hash digest
SHA256 106bc8908148d54ed4889038549cd81f11abc651e5ef30c9fad0a4e3c0285b1d
MD5 6738d87bb46174fe95f44e07751f494b
BLAKE2b-256 1f0e442303158fa805ebe0cc42d9448bab3514af671da4df3e0ca096535a14e2

See more details on using hashes here.

File details

Details for the file segment_intersection_2d-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for segment_intersection_2d-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5e158a587f7bb4ea63ec1e12b09e442a042593909e26575acafefcd82d651b73
MD5 bcc734b0fde5793918139a1db6debeb6
BLAKE2b-256 fdd3ace2d761f76dadf2eb435483c23399c9086d7ef25d88bb4806f4907e1eb6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page