I'm looking for a quick and elegant manner to solve this problem:
I have two noncontinuous line, like the black ones in this image:

For each, I have two vectors - one defining the starting points of each segment and the other defining the ending points.
I am looking for a MATLAB script that will give me the start and end points for the blue line, which is the intersection of the two lines.
I could, of course, create two vectors, each containing all the elements in the black lines, and then use "intersect". However, since the numbers here are in billions, the size of these vectors will be huge and the intersection will take long.
Any ideas?