find next postion knowing lat/lon/heading/speed

前端 未结 2 1314
轮回少年
轮回少年 2021-01-19 17:01

knowing a decimal latitude, decimal longitude, speed (km/h), heading how to find the next positio

2条回答
  •  伪装坚强ぢ
    2021-01-19 17:19

    This might help:

    distance_traveled = speed * time
    

    Then, calculate x and y components of speed using heading as angle (trigonometry):

    speed_x=distance_traveled * Math.Cos(heading/180*Math.PI)
    speed_y=distance_traveled * Math.Sin(heading/180*Math.PI)
    

    Next, see how to map lat/long into some form of x/y coordinates, add speed_x and speed_y, and convert to lat/long again.

    This last one is a tricky one, look here: http://www.movable-type.co.uk/scripts/latlong.html

    In fact, you'll find everything within that article!

提交回复
热议问题