Skip to main content

Intersection Of two curves

Project description

Intersection Of two curves in Pure numpy

PyPI Changelog Tests License

Inspired from this matlab implementation, wrote this python implementation of how to detect intersection of two curves.

image

Example usage

from intersect import intersection

a, b = 1, 2
phi = np.linspace(3, 10, 100)
x1 = a*phi - b*np.sin(phi)
y1 = a - b*np.cos(phi)

x2 = phi
y2 = np.sin(phi)+2
x, y, i, j = intersection(x1, y1, x2, y2)

print(f"curves intersect at elements {i, j}, corresponding to coordinates {x,y}")
plt.plot(x1, y1, c="r")
plt.plot(x2, y2, c="g")
plt.plot(x, y, "*k")
plt.show()

Install

To install

pip install intersect

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

intersect-1.3.2.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

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

intersect-1.3.2-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file intersect-1.3.2.tar.gz.

File metadata

  • Download URL: intersect-1.3.2.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for intersect-1.3.2.tar.gz
Algorithm Hash digest
SHA256 9c67ec5529bd231ddb46547221db52055250ff96278d8a939fc90962026964d2
MD5 6a084e39c9441ce34457c2000a4179e2
BLAKE2b-256 7b0fb709e4f574bbb73aff193eed03bde817592cc6c673a2f95dfdc8e9949ac6

See more details on using hashes here.

Provenance

The following attestation bundles were made for intersect-1.3.2.tar.gz:

Publisher: publish.yml on sukhbinder/intersection

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file intersect-1.3.2-py3-none-any.whl.

File metadata

  • Download URL: intersect-1.3.2-py3-none-any.whl
  • Upload date:
  • Size: 4.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for intersect-1.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 45705770f2060355ff99e34d7329c1bd7510d920f52284a4aea15606d8daebb3
MD5 3a32f1ad3c819aff78f9ac093eede79c
BLAKE2b-256 2d0b5ceb67103c2c7091491ea225d82f3b174d2aeb45da5f0f391703ffd83115

See more details on using hashes here.

Provenance

The following attestation bundles were made for intersect-1.3.2-py3-none-any.whl:

Publisher: publish.yml on sukhbinder/intersection

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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