Finding a coordinate at some distance from the sou

2019-09-19 03:19发布

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条回答
我欲成王,谁敢阻挡
2楼-- · 2019-09-19 03:53

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.

查看更多
登录 后发表回答