double a,b,s,radLat1,radLat2;
//球半径 private static final double EARTH_RADIUS = 6378.137;
private double getDistanceFromXtoY(double lat_a,double lng_a,double lat_b,double lng_b){ radLat1=rad(lat_a); radLat2=rad(lat_b); a=rad(lat_a)-rad(lat_b); b=rad(lng_a)-rad(lng_b); 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*=1000; return s; }