How to calculate cross track distance to great cicle line and rhumb line?

For great circle line, I've tried this formula, but it is not accurate while the distance is less than 0.1nm.

For rhumb line, I've applied the cartesian vector projection method(see: dist_Point_to_Segment). Take one point as origin and calculate vectors based on rhumb distance and bearing. Then find the closest point on rhumb line, and calculte great circle distance on it. But I'm not sure whether this method is correct for the case.

  • You probably need to provide more details about your problem. How did you decide the referenced formula was not accurate? – Martin F Nov 7 '14 at 5:44
  • Are you talking about accuracy of spherical verses ellipsoidal computational geodesy? – Martin F Nov 8 '14 at 23:55

See this link for code (using GeographicLib) to compute the cross track distance to a geodesic. This does the ellipsoidal calculation and is accurate to 20 nanometers or so.

Also look at "Calculation 2. Distance from a point to a line" on this site. This calculates the cross track path with Javascript and displays the result.

  • 1
    Great, just what I wanted. But what about the distance to rhumb line? Pls see my updated question. – feverzsj Nov 10 '14 at 3:03

The solution for the cross-track distance to a rhumb line is giving in this link which computes an accurate intercept for the WGS84 ellipsoid given a sufficiently accurate initial guess. This computes the shortest geodesic intercept. The geodesic intercept has the nice property that the angle of interception is 90°. (This isn't the case if the intercept path is the shortest rhumb line or shortest great ellipse.) The solution is via Newton's method solving for a zero of the cosine of the intercept angle. The same method can be applied to the calculation of the cross-track distance to a geodesic (and this provides an alternative solution to that given by my previous answer).

  • Thank you very much for your excellent answers. They solved my problem perfectly. – feverzsj Nov 25 '14 at 5:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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