如何计算两个地理/ GPS坐标之间的角度? [英] How to calculate angle between two Geographical/GPS coordinates?

查看:915
本文介绍了如何计算两个地理/ GPS坐标之间的角度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个GPS坐标

例如。 (Lat1,Long1)和(Lat2,Long2)



任何人都可以帮我找到这两点之间的角度。

值应该是0-360度。

解决方案

我想你的意思是方位角而不是角度位置:如果(lat1,long1)存储在 Location 对象 loc1 中且(lat2,long2)存储在 loc2 你从loc1到loc2的方位是这样的:

  float bearing = loc1.bearingTo(loc2); 

结果以真北方向为度数,其初始方位(如果loc1和

Location 类中还有其他一些有用的方法,请参阅此处了解更多详情: http://developer.android.com/reference/android/location /Location.html



编辑:我假设Android为答案,但是,标签并不意味着...


I have two GPS Coordinates

e.g. (Lat1, Long1) and (Lat2,Long2)

Could anybody please help me find the angle between those two points.

Values should be 0-360 degrees.

解决方案

I suppose you mean the bearing to and not the angle between the locations: If (lat1,long1) is stored in a Location object loc1 and (lat2,long2) is stored in loc2 you get the bearing from loc1 to loc2 like this:

float bearing = loc1.bearingTo(loc2);

The result is in degrees east of true north and its the initial bearing (which is important if loc1 and loc2 are far apart from each other).

There are some other useful methods in the Location class, see here for more details: http://developer.android.com/reference/android/location/Location.html

EDIT: I assumed Android for the answer, but yes, the tags do not imply that ...

这篇关于如何计算两个地理/ GPS坐标之间的角度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆