How can we find the angle between two locations defined by latitude or longitude

旧城冷巷雨未停 提交于 2020-01-10 04:36:06

问题


I do not want any code but want to get reference that how can we find the angle between two locations defined by Latitude or Longitude...

If you do have reference then Please help me to solve my problem...

Thanx in advance....


回答1:


The formula to calculate bearing is:

θ = atan2( sin(Δlong).cos(lat2), cos(lat1).sin(lat2) − sin(lat1).cos(lat2).cos(Δlong) )

Bearing is a direction to move from one location to another location (starting from north and then clockwise). While angle in 2D starts from the east and then counter clockwise. So if an angle is what you need, later you'll need to add 90 degree to the result and then revert it (add minus).

Reference: http://www.movable-type.co.uk/scripts/latlong.html




回答2:


try the Atan method

Math.Atan2(x1-x2,y1-y2)            



回答3:


Try this website, it does all the calculations for you. Whereas the formulas, those can be found on wiki or any other sites. I like this site cos it managed to help me settle a lot of problems. And even if this web tool was developed in San Francisco, even I am from Singapore. This will work.

Latitude and Longitude web tool



来源:https://stackoverflow.com/questions/6745131/how-can-we-find-the-angle-between-two-locations-defined-by-latitude-or-longitude

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