How to measure the distance covered by iphone during free fall?

前端 未结 10 1982
耶瑟儿~
耶瑟儿~ 2021-02-02 02:26

During the free fall the iphone is supposed to send acceleration values as 0 on all the three axis. So how to detect the distance covered by the iphone?

10条回答
  •  -上瘾入骨i
    2021-02-02 03:29

    The most simple and naive implementation is to sample the accelerometerdata and use the following formula.

    v+=a*dt;
    d+=v*dt;
    

    But this is can give drift over time, read this for explanation why and a better solution: http://gafferongames.com/game-physics/integration-basics/

提交回复
热议问题