0
$\begingroup$

I'm looking for an efficient way to determine if two paths (sets of x,y coordinates) intersect at a point.

Input - (x,y) from a Mercator Projection (longitude,latitude) coordinates

Output - Intersection point

I looked at this question here: Solve for the intersection point, given two sets of data but there doesn't seem to be an answer.

Does anyone have any suggestions on where to start?

1 Answers 1

2

You can find the interpolation equation of p1=ax+b for x1,y1 points and p2=cx+d for x2,y2 points using "Least Squares method" . Then solve for p1=p2.

If you know that some intersections occurs between some "specific points inside the bound" and calculating intersection coordinates matters, you may fit the points you have in a polynomial (Using Newton's Limited Divided Differences method or Lagrange method). Then numerically solve for P1=P2 ( Caution: This interpolation may fail for points far out of bound of the given points)