老系统对接

This commit is contained in:
2018-07-12 14:08:55 +08:00
commit 5f41fe5df1
420 changed files with 50883 additions and 0 deletions

View File

@ -0,0 +1,39 @@
/*
* Created on 2006-3-17
*
*
* Window - Preferences - Java - Code Style - Code Templates
*/
package com.sino.publicclass.util;
/**
* @author JosephZhou
*
*
* Window - Preferences - Java - Code Style - Code Templates
*/
public class MapUtil {
/**
*
*/
public MapUtil() {
super();
//
}
public static long distance(double lon1,double lat1,double lon2,double lat2)
{
double R=6378136.49;
double PI=Math.PI;
double dlon=Math.abs(lon1-lon2);
if(dlon>180)dlon=360-dlon;
double lsqure=2-2*Math.sin(lat1*PI/180)*Math.sin(lat2*PI/180)-2*Math.cos(lat1*PI/180)*Math.cos(lat2*PI/180)*Math.cos(dlon*PI/180);
double d=Math.asin(Math.sqrt(lsqure)*0.5)*2*R;
return Math.round(d*100);
}
public static void main(String[] args) {
System.out.println(MapUtil.distance(0.0075,31.236111,0.0041667,31.237222));
}
}