Intersection of curves in python
Python
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
images added readme and image Apr 10, 2017
LICENSE added readme and image Apr 10, 2017
intersection.py faster version Apr 11, 2017
readme.md update readme.md with python code May 22, 2017

readme.md

Intersection Of two curves in Pure numpy

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

image

Example usage

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=intersection(x1,y1,x2,y2)

plt.plot(x1,y1,c="r")
plt.plot(x2,y2,c="g")
plt.plot(x,y,"*k")
plt.show()