code: public static double alongTrackDistanceDeg(double lat1, double lon1, double lat2, double lon2, double latQ, double lonQ, double dist1Q, double ctd) {
      return alongTrackDistanceRad(deg2rad(lat1), deg2rad(lon1), deg2rad(lat2), deg2rad(lon2), deg2rad(latQ), deg2rad(lonQ), dist1Q, ctd);
    }
docs: The along track distance is the distance from S to Q along the track from
  S to E.
  <p>
  ATD=acos(cos(dist_SQ)/cos(XTD))
  
  @param lat1 Latitude of starting point.
  @param lon1 Longitude of starting point.
  @param lat2 Latitude of destination point.
  @param lon2 Longitude of destination point.
  @param latQ Latitude of query point.
  @param lonQ Longitude of query point.
  @param dist1Q Distance S to Q in radians.
  @param ctd Cross-track-distance in radians.
  @return Along-track distance in radians. May be negative - this gives the
  side.