已知經緯度、偏移角度、偏移距離,計算經緯度


/**************************************************************************
*從指定的原點出發,偏移輸入角度后,向此方向延伸輸入距離,返回此時的位置
*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