标签:distance mat 延伸 offset 角度 ble fse return []
/**************************************************************************
*从指定的原点出发,偏移输入角度后,向此方向延伸输入距离,返回此时的位置
*origin_lon:原点经度
*origin_lat:原点纬度
*azimuth:偏移角度
*distance:延伸距离
*ret_lon:返回位置的经度
*ret_lat:返回位置的纬度
**************************************************************************/
public static Double[] azimuth_offset(double origin_lon, double origin_lat, Integer azimuth,double distance)
{
Double[] lonlat=new Double[2];
if(azimuth!=null && azimuth.equals(0) && distance>0){
lonlat[0] = origin_lon + distance * Math.sin(azimuth* Math.PI / 180) * 180 / ( Math.PI * 6371229 * Math.cos(origin_lat * Math.PI / 180));
lonlat[1] = origin_lat + distance * Math.cos(azimuth* Math.PI / 180) / ( Math.PI * 6371229 / 180);
}else{
lonlat[0]=origin_lon;
lonlat[1]=origin_lat;
}
return lonlat;
}
标签:distance mat 延伸 offset 角度 ble fse return []
原文地址:https://www.cnblogs.com/seeYagain/p/9889991.html