Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|cite|improve this question

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)

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.