Calculate angle between two Latitude/Longitude points

后端 未结 17 1376
故里飘歌
故里飘歌 2020-12-07 17:51

Is there a way to calculate angle between two Latitude/Longitude points?

What I am trying to achieve is to know where the user is heading. For example, user is head

17条回答
  •  执笔经年
    2020-12-07 18:26

    With javascript, just use Turf:

    var point1 = turf.point([-75.343, 39.984]);
    var point2 = turf.point([-75.534, 39.123]);
    
    var bearing = turf.bearing(point1, point2);
    

提交回复
热议问题