如何使用加速度计测量iPhone的行进距离?

如何使用加速度计测量iPhone的行进距离?

问题描述:

虽然GPS适用于长距离更换,但我想使用iPhone的加速度计测量更短的距离。

While GPS works for long distance changes, I would like to measure a shorter distance by using the iPhone's accelerometer.

说我想测量一个盒子的高度使用iPhone应用程序。您可以启动应用程序,按一个按钮在框底部开始测量,将iPhone移动到框顶部,然后按一个按钮停止测量。然后,应用程序将计算并显示框的高度。

Say I want to measure a height of a box using an iPhone application. You'd start the application, press a button to start measurement at the bottom of a box, move your iPhone from to the top of the box, then press a button to stop measurement. The application would then calculate and display the height of the box.

我如何使用加速度计执行此类测量?

How would I use the accelerometer to perform this kind of measurement?

尝试在感兴趣的距离拍摄已知大小的物体。

Try photographing an object of a known size at the distance of interest.