public class FCDTools {
public final static double PI = 3.14159265354;
private final static double D2R = 0.017453 ;
private final static double a2 = 6378137.0;
private final static double e2 = 0.006739496742337;
public static double Distance(FCD_Point pt1, FCD_Point pt2) {
if(pt1.lng == pt2.lng && pt1.lat == pt2.lat ) {
return 0.0;
} else {
double fdLambda =(pt1.lng - pt2.lng) * D2R;
double fdPhi = (pt1.lat - pt2.lat) * D2R;
double fPhimean = ((pt1.lat + pt2.lat) / 2.0) * D2R;
double fTemp = 1 - e2 * (Math.pow (Math.sin(fPhimean),2));
double fRho = (a2 * (1 - e2)) / Math.pow (fTemp, 1.5);
double fNu = a2 / (Math.sqrt(1 - e2 * (Math.sin(fPhimean) * Math.sin(fPhimean))));
double fz = Math.sqrt (Math.pow(Math.sin(fdPhi