//在网上找的,所说是谷歌的算法,我把参数和返回值的单位改了,传入经纬度的毫秒,返回距离毫米
    
    public class Maps {
     private static  double EARTH_RADIUS = 6378.137;//一般的认为,地球的赤道半径是6378137米
    
     private static double rad(double d)
     {
        return d * Math.PI / 180.0;
     }
    
     public static int GetDistance(int lat1, int lng1, int lat2, int lng2)
     {
        double radLat1 = rad(lat1/3600000d);
        double radLat2 = rad(lat2/3600000d);
        double a = radLat1 - radLat2;
        double b = rad(lng1/3600000d) - rad(lng2/3600000d);
        double s = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a/2),2) +
         Math.cos(radLat1)*Math.cos(radLat2)*Math.pow(Math.sin(b/2),2)));
        s = s * EARTH_RADIUS;
        s = Math.round(s * 1000*100*10) ;
        return (int) s;
     }
     public static void main(String[] args) {
      System.out.println(Maps.GetDistance(115323149,  427590821, 115411079, 427564354));
     }
    }