var lat_per_m = 360 / Math.PI / 2 / 6378150;
function latLngAddDirDis(latlon, dir, dis)
{
// 緯線上の移動距離
lat_dis = Math.cos(dir * Math.PI / 180) * dis;
// 緯度の変化量
lat_delta = lat_dis * lat_per_m;
new_lat = latlon.Lat + lat_delta;
// 経線上の移動距離
lon_dis = Math.sin(dir * Math.PI / 180) * dis;
// 1mあたりの経度
lon_per_m = 360 / Math.PI / 2 / 6378150 / Math.cos(new_lat * Math.PI / 180);
// 経度の変化量
lon_delta = lon_dis * lon_per_m;
return new Y.LatLng(new_lat, latlon.Lon + lon_delta);
}
More than 5 years have passed since last update.
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme