首页 > 其他 > 详细

已知经纬度、偏移角度、偏移距离,计算经纬度

时间:2018-11-01 16:35:34      阅读:358      评论:0      收藏:0      [点我收藏+]

/**************************************************************************
*从指定的原点出发,偏移输入角度后,向此方向延伸输入距离,返回此时的位置
*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;
}

已知经纬度、偏移角度、偏移距离,计算经纬度

原文:https://www.cnblogs.com/seeYagain/p/9889991.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!