Finding a coordinate at some distance from the source

淺唱寂寞╮ 提交于 2019-12-13 03:11:13

问题


I am working on an iPhone app where I need to find some coordinates at some distance from a given point.

The user touches the map and I get coordinates at the touch. Now I have to find some coordinates which are about 5 km away towards east and another one about 5km down to south. I have searched the web but could not find any algorithm for it.

I am not sure this is correct place for this question or whether I need to find some other section where I can find questions related to maths.


回答1:


If Earth's circumference is C, the point at d kilometers to south of a given point is 360*d/C degrees to the south. The point at d kilometers to east is 360*d/(C*cos(latitude)) degrees to the east.

So if Earth's circumference is 40075.04 km, to move 5 km to the south you would subtract 0.0449 from the latitude and use the same longitude. To move 5 km to the east you would use the same latitude and add 0.0449/cos(latitude) to the longitude.



来源:https://stackoverflow.com/questions/14398378/finding-a-coordinate-at-some-distance-from-the-source

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!