I'm trying to find the intersection between two lines that were generated by a list of points.
I had two list of points, and then I plotted them using
import matplotlib.pyplot as plt
import numpy as np
a = arrayOfPoints1
plt.plot(*zip(*a))
b = arrayOfPoints2
plt.plot(*zip(*b))
plt.show()
Now I've generated a graph that looks something like this
My goal is to find all the points where these two graphs intersect now (the blue and green line intersections). At first glance, it might seem like the points would just be the points that are in both array a and b, but there could be some intersections that occur that are not in the arrays when the lines between the points are generated.
How do I go about finding all the intersections?
Note: I'm looking for a solution that works in Python 2.7