DeviceMotionEvent: acceleration プロパティ
Baseline
Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2023年9月.
acceleration プロパティは、端末によって記録された加速度の量をメートル毎秒毎秒 (m/s²)単位で返します。
DeviceMotionEvent.accelerationIncludingGravity とは異なり、加速度値は重力の影響を含みません。
メモ:
ハードウェアが加速度データから重力を除去する方法を知らない場合、DeviceMotionEvent にこの値が存在しないことがあります。この場合、代わりに DeviceMotionEvent.accelerationIncludingGravity を使用する必要があります。
値
acceleration プロパティは 3 軸の加速度に関する情報を提供するオブジェクトです。それぞれの軸は自分自身でプロパティを使って表します。
仕様書
| Specification |
|---|
| Device Orientation and Motion> # dom-devicemotionevent-acceleration> |