Skip to content

Latest commit

History

38 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Intersection Of two curves in Pure numpy

PyPIChangelogTestsLicense

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

image

Example usage

fromintersectimportintersectiona, b=1, 2phi=np.linspace(3, 10, 100)
x1=a*phi-b*np.sin(phi)
y1=a-b*np.cos(phi)
x2=phiy2=np.sin(phi)+2x, 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

About

Intersection of curves in python

Topics

Resources

Stars

93 stars

Watchers

6 watching

Forks

Releases

Packages

Used by

Contributors

Languages