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

前端 未结 10 1979
耶瑟儿~
耶瑟儿~ 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条回答
  •  不思量自难忘°
    2021-02-02 03:07

    Ignoring air drag:

    float t; // time since drop
    float distance = 9.81f * 0.5f * t * t;
    

    For greater distance (drop from airplane) you also could use the location services. CLLocation contains an altitude.

提交回复
热议问题