[GIS] cross track distance to great cicle line and rhumb line

distancegreat circlerhumb-line

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.

Best Answer

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.