Calculating Speed for a navigation app without getSpeed() method

前端 未结 4 1107
野性不改
野性不改 2020-12-28 23:42

I am developing an app which is more of a time-shift racing between your friends.

I need to calculate speed of a moving vehicle, and I don\'t want to use Locat

4条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2020-12-29 00:36

    Omg.....

    Location

    Check this method - it allows you to calculate distance between 2 geo points, just divide it by your time. It should be much more accurate than yours as it calculates distances with much better approximation (WGS83 instead of using sin, cos and rest of this stuff).

    Good, general idea is to keep all your data in plain units like m, s, kg etc. and make changes only for showing data to user.

提交回复
热议问题