# Divide set of coordinates into sub-sets using intersections with the vector

I'm trying to solve coordinate related problem.

I have a large set of X,Y coordinates (logged by the GPS device during circuit racing, the driver makes 10-20 laps during one racing session) and a vector (a line that marks start/finish of the circuit/lap).

I need to divide large set of coordinates into sub-sets using intersections with the start/finish vector.

How can I solve this problem?

Thank You

-

Are the subsets supposed to be the those of each lap? Note that your coordinates are really (X,Y,t). If you list them in time order, you can just look for pairs where the segment from $(X_i,Y_i)$ to $(X_{i+1},Y_{i+1})$ crosses start/finish. Is that what you are after?

-
Yes this is what I'm after. I have not thought about time aspect and yes each subset contains coordinates for 1 lap. Thank You! – Daniil Harik Feb 14 '11 at 17:45