I have two curves where I would like to find their intersection point. The data could look something like this:
import matplotlib.pyplot as plt
y1 = [1, 5, 9, 14, 21, 27, 42, 50]
x1 = list(range(1, len(x1) + 1))
y2 = [60, 50, 40, 34, 30, 28, 23, 19, 16, 10, 5, 3]
x2 = list(range(5, len(x2) + 5))
plt.plot(x1, y1, marker="o")
plt.plot(x2, y2, marker="o")
plt.show()
Resulting in this:
As you can see they don't necessarily share the same x,y
coordinates, i.e. it has to be the intersection between the lines that is drawn between the two pairs or dots/points.
Is there any way to achieve this ?