GPS/GIS Calculations: Algorithm to predict future position based on movement/mph?

后端 未结 2 1705
一个人的身影
一个人的身影 2021-02-06 06:21

Looking for resources or algorithm to calculate the following in a navigation app:

If my current GPS position is (0,0) and I\'m heading 32 degrees at 15 miles per hour,

2条回答
  •  花落未央
    2021-02-06 06:58

    Here are the formulas that you need.

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

    Hope that helps.

    Bob

    [update] Here are the formulas in JavaScript (copied from source)

    var lat2 = Math.asin( Math.sin(lat1)*Math.cos(d/R) +                       Math.cos(lat1)*Math.sin(d/R)*Math.cos(brng) ); var lon2 = lon1 + Math.atan2(Math.sin(brng)*Math.sin(d/R)*Math.cos(lat1),                              Math.cos(d/R)-Math.sin(lat1)*Math.sin(lat2));

    d=distance traveled=velocity x time R=radius of the earth

提交回复
热议问题