将地球上的距离转化为经纬度差
本算法的目标是已知地球上某一位置,以及沿某一方向的距离,计算该方向该距离上的点到该位置的经度差及纬度差,本算法使用java实现:
// 将地球上的距离转换为经纬度差,angle为两点之间连线与正北方向夹角,lat为纬度
public static double toDLatLon(double length, double angle,double lat) {
double nbLength = length*Math.abs(Math.cos(toRadians(angle)));
double dxLength = length*Math.abs(Math.sin(toRadians(angle)));
nbLength = nbLength/6371000.0*180/Math.PI;
dxLength = (dxLength/Math.cos(toRadians(lat)))/6371000.0*180/Math.PI;
return Math.sqrt((nbLength*nbLength)+(dxLength*dxLength));
}
亲测可用