Apple 或 Android 如何计算设备的速度?

How does Apple or Android calculate speed in devices?

有这方面的文档吗?我检查了很多公式和算法,但没有找到明确定义它们如何获得 Geolocation 对象中提供的速度。

它主要扫描您的位置(即您的纬度和经度)并与上次检查进行比较。使用欧式距离,可以得到时间段内的距离。随着时间的推移(例如,如果它每 2 秒扫描一次您的位置),它可以通过执行 Speed = Distance/2.

轻松估计您的速度

GPS 芯片组向系统提供当前速度和当前位置。

芯片组可以通过比较随时间变化的位置并校正当前位置的地球曲率来计算速度,或者根据接收到的卫星信号的多普勒频移来计算速度。

无论使用哪种方法,操作系统都不需要做任何处理来获得速度。速度数据连同位置和高度数据一起直接从 GPS 芯片提供(实际上,许多较新设备中的芯片同时支持 GPS 和 GLONASS,但用户看不到使用哪个系统)。

Physics.org 有一个 simple explanation of how GPS works

Wherever you are on the planet, at least four GPS satellites are ‘visible’ at any time. Each one transmits information about its position and the current time at regular intervals. These signals, travelling at the speed of light, are intercepted by your GPS receiver, which calculates how far away each satellite is based on how long it took for the messages to arrive.

Once it has information on how far away at least three satellites are, your GPS receiver can pinpoint your location using a process called trilateration.

但是你可以搜索更详细的数学和物理解释。