DeviceMotionEvent: rotationRate プロパティ

Baseline 2023

Newly available

Since September 2023, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.

DeviceMotionEvent.rotationRate は読み取り専用プロパティで、端末がそれぞれの軸を中心に回転している秒あたりの角度を返します。

メモ: ハードウェアがこの情報を提供できない場合、このプロパティは null を返します。

rotationRate プロパティは読み取り専用のオブジェクトで、端末の各軸に沿った回転速度を記述します。

alpha

端末が Z 軸を中心に回転している速度です。つまり、画面に垂直な線を中心に回転している速度です。

beta

端末が X 軸、つまり後ろから横に向かう軸を中心に回転している速度です。

gamma

端末が Y 軸、つまり横から横へ向かう軸を中心に回転している速度です。

仕様書

Specification
DeviceOrientation Event Specification
# ref-for-dom-devicemotionevent-rotationrate②

ブラウザーの互換性

BCD tables only load in the browser

関連情報