iphone - iPhone 加速度计究竟测量什么?

标签 iphone ios physics accelerometer

apple documentation for UIAcceleration class说,

"When a device is laying still with its back on a horizontal surface, each acceleration event has approximately the following values:
x: 0
y: 0
z: -1
"

现在,我很困惑!当您清楚地说“设备静止不动”时,加速度怎么可能不为零?

更新

从 react 来看,我认为这应该称为“力计”或“重力计”之类的东西,而不是加速度计!

最佳答案

您在 Z 轴上得到 -1,因为重力作用在设备上,施加 1G 的恒定加速度。我假设您需要用户加速,您可以从 DeviceMotion 获得使用设备运动处理程序而不是加速处理程序的对象。 userAcceleration 属性过滤掉重力对设备的影响,只提供用户加速的程度。

关于iphone - iPhone 加速度计究竟测量什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9293850/

相关文章:

排除因内存导致的 iPhone/iPad 设备崩溃问题

iphone - 在屏幕的特定部分打开 zbar 扫描仪

ios - 苹果分发证书导致 14094410 :SSL routines:SSL3_READ_BYTES:sslv3 alert handshake failure

javascript - 随机速度向量公式

iphone - 应用 CGAffineTransform 旋转后计算偏移量

iphone - 缺少 UIView 的 anchorPoint 属性

c - iOS - 在 plCrashReporter 中使用 PRIx64 打印内存地址

ios - 为什么 KVO 不能在 UIView 子类上工作?

python - 模拟量子谐振子/SHM

Swift SceneKit——物理 block 不会相互粘连