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


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


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM