Hi consider each point pair(vertices) form a edge. In that way construct a list of edges for time series 1 and another list for time series 2

for example the series goes like edge1(pt1,pt2) edge2(pt2,pt3) ....so on one vertex overlap with the previous edge.

Now in a double loop check

[this is a pseudo code]

for each edge1 in edgelist1

for each edge2 in edgelist2

check if edge1 intersect edge2 then break and return those intersection point

end

end

now how to check it intersect or not. By the rule if two edges intersect then the rectangle (bounding space) created by it also intersect. Say for example edge1 (10,10 20,20) edge2 (10,20 30,10). If plotted these edges intersect. Let us prove. Bound rect for edge1 = rect(10,10 20,10 20,20 10,20) and bound rect for edge2= rect(10,20 10,30 30,10 30,20). See both rect has a common point 10,20 so it intersects.

But this is not the case always. There won't be a common point of the rects present instead one corner of the rect will present in the other rects space (that you can find out from if the corner x is between x range of other rect and corner y is between the y range of other rect). If so, then both edges are intersecting. Find the intersection point and return.

hope this give you an idea

15,917,176 members