static double geodesicDistanceOnWGS84Impl(Point ptFrom, Point ptTo) {
double a = 6378137.0; // radius of spheroid for WGS_1984
double e2 = 0.0066943799901413165; // ellipticity for WGS_1984
double rpu = Math.PI / 180.0;
PeDouble answer = new PeDouble();
GeoDist.geodesic_distance_ngs(a, e2, ptFrom.getXY().x * rpu,
ptFrom.getXY().y * rpu, ptTo.getXY().x * rpu, ptTo.getXY().y
* rpu, answer, null, null);
return answer.val;
}