方位センサー

W3C 作業草案,

この文書についての詳細
このバージョン:
https://www.w3.org/TR/2026/WD-orientation-sensor-20260514/
最新公開バージョン:
https://www.w3.org/TR/orientation-sensor/
エディターズドラフト:
https://w3c.github.io/orientation-sensor/
以前のバージョン:
履歴:
https://www.w3.org/standards/history/orientation-sensor/
フィードバック:
public-device-apis@w3.org に、件名行を “[orientation-sensor] … メッセージのトピック …” として送信(アーカイブ
Orientation Sensor 課題 リポジトリ
編集者:
Kenneth Rohde Christiansen (Intel Corporation)
Anssi Kostiainen (Intel Corporation)
以前の編集者:
Mikhail Pozdnyakov (Intel Corporation)
Alexander Shalamov (Intel Corporation)
テストスイート:
GitHub 上の web-platform-tests

概要

この仕様は、静止した三次元デカルト座標系に対するデバイスの 物理的な方位を監視するための、基本方位センサーインターフェイスと 具象センサーサブクラスを定義する。

この文書のステータス

この節は、この文書の公開時点におけるステータスを説明する。 現在の W3C 公開物の一覧と、この技術報告の最新改訂は、 W3C 技術報告 インデックスで見つけることができる。

この文書は、 Devices and Sensors Working Group により、勧告 トラックを用いた Working Draft として公開された。この文書は W3C 勧告となることを意図している。

この文書に関するコメントを行いたい場合は、 public-device-apis@w3.org購読アーカイブ)宛てに送信してほしい。 電子メールを送信するときは、 件名に “orientation-sensor” というテキストを含めてほしい。 できれば次のようにする: “[orientation-sensor] …コメントの概要…”。 すべてのコメントを歓迎する。

Working Draft としての公開は、 W3C およびその会員による承認を意味しない。これは草案文書であり、 いつでも他の文書により更新、置換、または 廃止される可能性がある。この文書を進行中の作業以外として引用することは不適切である。

この文書は、 W3C 特許ポリシーの下で運営されるグループにより作成された。 W3C は、そのグループの成果物に関連して行われた特許開示の公開一覧を 維持している。 そのページには、特許を開示するための手順も含まれている。 ある個人が、その個人の考えでは必須クレームを含む特許について実際の知識を有する場合、 W3C 特許ポリシーの 6 節に従って情報を開示しなければならない。

この文書は、2025年8月18日付 W3C プロセス文書により管理される。

この仕様は既存のデプロイメントのために維持されている。複数のブラウザーエンジンが この仕様について懸念を表明している。新規プロジェクトでは、開発者は クロスエンジン対応を持つ Device Orientation and Motion を使用するべきである。 Working Group は、新しいモーション検知機能を Device Orientation and Motion で開発する意向である。

Devices and Sensors Working Group は、この仕様およびプライバシーとセキュリティの レビュー慣行の両方における変化量を考慮して、この仕様に対する現代的なセキュリティおよびプライバシー レビューを進めている。これは、水平レビューが 2019年10月14日に行われた後の 変化を考慮したものである。同様に、このグループは、最新の アーキテクチャレビュー慣行を反映するために、この仕様に対する Technical Architecture Group レビューの更新も進めている。

1. 導入

Orientation Sensor API は Generic Sensor API [GENERIC-SENSOR] を拡張し、三次元デカルト座標系に対するデバイスの物理的な方位を 記述する汎用情報を提供する。

AbsoluteOrientationSensor クラスは OrientationSensor インターフェイスから継承し、 地球の 参照座標系に対するデバイスの物理的な方位を記述する。

他のサブクラスは、真北などの他の静止した方向、または デバイス自身の z 位置に対して、その最新の最も安定した z 位置へ ドリフトしていくような非静止方向に対する方位を記述する。

OrientationSensor サブクラスにより提供されるデータは、 DeviceOrientationEvent からのデータと類似しているが、Orientation Sensor API には次の重要な違いがある:

  1. Orientation Sensor API は、方位データを WebGL 互換形式(クォータニオン、 回転行列)で表す。

  2. Orientation Sensor API は、より厳格なレイテンシー要件を満たす。

  3. DeviceOrientationEvent とは異なり、 OrientationSensor サブクラスは、方位データを取得するためにどの 低レベル モーションセンサーが使用されるかを明示的に定義し、それにより起こり得る相互運用性の問題を 不要にする。

  4. OrientationSensor サブクラスのインスタンスは、 SensorOptions コンストラクター引数を介して設定可能である。

2. ユースケースと要件

ユースケースと要件は、 Motion Sensors Explainer 文書で議論されている。

3.

const sensor = new AbsoluteOrientationSensor();
const mat4 = new Float32Array(16);
sensor.start();
sensor.onerror = event => console.log(event.error.name, event.error.message);

sensor.onreading = () => {
  sensor.populateMatrix(mat4);
};
const sensor = new AbsoluteOrientationSensor({ frequency: 60 });
const mat4 = new Float32Array(16);
sensor.start();
sensor.onerror = event => console.log(event.error.name, event.error.message);

function draw(timestamp) {
  window.requestAnimationFrame(draw);
  try {
    sensor.populateMatrix(mat4);
  } catch(e) {
    // mat4 has not been updated.
  }
  // Drawing...
}

window.requestAnimationFrame(draw);

4. セキュリティとプライバシーに関する考慮事項

Generic Sensor API [GENERIC-SENSOR] で説明されているものを超える、 特定のセキュリティおよびプライバシーに関する考慮事項はない。

5. モデル

OrientationSensor クラスは Sensor クラスを拡張し、デバイス方位データを表す汎用インターフェイスを提供する。

Orientation Sensor センサー型最新読み取り値に アクセスするために、ユーザーエージェントは、具象方位センサーが使用する各低レベルセンサーについて、 センサーアクセスを要求する抽象操作を呼び出さなければならない。 下の表は、具象方位センサーと、低レベルセンサーにより定義される許可トークンとの対応関係を記述する。

OrientationSensor サブクラス 許可トークン
AbsoluteOrientationSensor "accelerometer", "gyroscope", "magnetometer"
RelativeOrientationSensor "accelerometer", "gyroscope"

AbsoluteOrientationSensor は、文字列 "accelerometer"、"gyroscope"、および "magnetometer" により識別される ポリシー制御機能である。その 既定の許可リスト'self' である。

RelativeOrientationSensor は、文字列 "accelerometer" および "gyroscope" により識別される ポリシー制御機能である。その 既定の許可リスト'self' である。

最新読み取り値は、Orientation Sensor センサー 型Sensor について、キーが "quaternion" であり、が 4 要素の リストを含む エントリーを含む。 リストの要素は、単位クォータニオン [QUATERNIONS] [Vx * sin(θ/2), Vy * sin(θ/2), Vz * sin(θ/2), cos(θ/2)] の成分に等しい。 ここで V は回転軸を表す単位ベクトル(その要素は Vx、Vy、および Vz)であり、 θ は単位ベクトル V により定義される軸まわりの回転角である。

注記: クォータニオン成分は、 リスト内に [q1, q2, q3, q0] [QUATERNIONS] として配置される。 すなわち、クォータニオンのベクトル部を表す成分が先に来て、cos(θ/2) に等しい スカラー部成分が後に来る。この順序は、既存のほとんどの WebGL フレームワークとの 互換性を高めるために使用される。 ただし、他のライブラリは、クォータニオンを配列として公開するときに別の順序、たとえば [q0, q1, q2, q3] を使用する可能性がある。

低レベルモーションセンサーの センサーフュージョンを 通して作成される具象 OrientationSensor サブクラスを下の表に示す:

OrientationSensor サブクラス 低レベルモーションセンサー
AbsoluteOrientationSensor Accelerometer, Gyroscope, Magnetometer
RelativeOrientationSensor Accelerometer, Gyroscope

注記: AccelerometerGyroscope および Magnetometer 低レベルセンサーは、それぞれ [ACCELEROMETER][GYROSCOPE]、および [MAGNETOMETER] 仕様で定義される。 センサーフュージョンはプラットフォーム固有であり、ソフトウェアまたは ハードウェア、すなわちセンサーハブ上で発生し得る。

この例のコードは、AbsoluteOrientationSensor について、start() を呼び出す前に、明示的に許可を照会する。
const sensor = new AbsoluteOrientationSensor();
Promise.all([navigator.permissions.query({ name: "accelerometer" }),
             navigator.permissions.query({ name: "magnetometer" }),
             navigator.permissions.query({ name: "gyroscope" })])
       .then(results => {
             if (results.every(result => result.state === "granted")) {
               sensor.start();
               ...
             } else {
               console.log("No permissions to use AbsoluteOrientationSensor.");
             }
       });

別の方法は、単に start() を呼び出し、 onerror イベントハンドラーを購読することである。

const sensor = new AbsoluteOrientationSensor();
sensor.onerror = event => {
  if (event.error.name === 'NotAllowedError')
    console.log("No permissions to use AbsoluteOrientationSensor.");
};
sensor.start();

5.1. AbsoluteOrientationSensor モデル

Absolute Orientation Sensor センサー型は、Motion Sensors Explainer § absolute-orientation で説明されるセンサーを表す。これに関連付けられた 拡張センサーインターフェイスAbsoluteOrientationSensorであり、 OrientationSensor のサブクラスである。 これに関連付けられた 仮想センサー型は "absolute-orientation" である。

絶対方位センサーについては、最新 読み取り値["quaternion"] の値は、 三次元デカルト座標系 (x, y, z) として定義される 地球の参照 座標系に対する、デバイスの ローカル 座標系の回転を表す。ここで:

デバイスの ローカル座標系は、低レベル モーションセンサーについて定義されるものと同じである。それは デバイス座標系または スクリーン座標系のいずれかであり得る。

注記: 下の図は、デバイスの ローカル座標系地球の 参照座標系が整列している場合を表す。したがって、 方位センサーの 最新読み取り値は、各軸まわりの 0 (rad) [SI] 回転を表す。

AbsoluteOrientationSensor coordinate system.

5.2. RelativeOrientationSensor モデル

Relative Orientation Sensor センサー型は、Motion Sensors Explainer § relative-orientation で説明されるセンサーを表す。これに関連付けられた 拡張センサーインターフェイスRelativeOrientationSensorであり、 OrientationSensor のサブクラスである。 これに関連付けられた 仮想センサー型は "relative-orientation" である。

相対方位センサーについては、最新 読み取り値["quaternion"] の値は、 静止参照座標系に対する、 デバイスの ローカル座標系の回転を表す。 静止参照座標系は、 ジャイロスコープセンサーにより導入されるバイアスによってドリフトし得る。したがって、 センサーにより提供される回転値は、時間とともにドリフトし得る。

静止参照座標系は、センサーをホストするデバイスが 環境内を移動しても静止したままである、慣性三次元 デカルト座標系として定義される。

デバイスの ローカル座標系は、低レベル モーションセンサーについて定義されるものと同じである。それは デバイス座標系または スクリーン座標系のいずれかであり得る。

注記: 相対方位センサーのデータは、 磁場の影響を受けないため、絶対方位センサーが提供するものより正確であり得る。

6. API

6.1. OrientationSensor インターフェイス

typedef (Float32Array or Float64Array or DOMMatrix) RotationMatrixType;

[SecureContext, Exposed=Window]
interface OrientationSensor : Sensor {
  readonly attribute FrozenArray<double>? quaternion;
  undefined populateMatrix(RotationMatrixType targetMatrix);
};

enum OrientationSensorLocalCoordinateSystem { "device", "screen" };

dictionary OrientationSensorOptions : SensorOptions {
  OrientationSensorLocalCoordinateSystem referenceFrame = "device";
};

6.1.1. OrientationSensor.quaternion

デバイス方位を表す単位クォータニオンの成分を要素として含む、 4 要素の FrozenArray を返す。 言い換えると、この属性は、 最新読み取り値から値を取得するthis および "quaternion" を引数として呼び出した結果を返す。

6.1.2. OrientationSensor.populateMatrix()

populateMatrix(targetMatrix) メソッドの手順は次のとおりである:
  1. targetMatrixFloat32Array または Float64Array 型であり、そのサイズが 16 未満である場合、"TypeError" 例外を投げ、 これらの手順を中止する。

  2. quaternion を、最新読み取り値から値を取得するthis および "quaternion" を引数として呼び出した結果とする。

  3. quaternionnull である場合、"NotReadableError" DOMException投げ、 これらの手順を中止する。

  4. rotationMatrix を、quaternion[0]、quaternion[1]、 quaternion[2]、および quaternion[3] を用いて クォータニオンを回転 行列に変換することの結果とする。

  5. targetMatrixFloat32Array または Float64Array 型である場合、次のサブ手順を実行する:

    1. targetMatrix[0] = rotationMatrix[0] に設定する

    2. targetMatrix[1] = rotationMatrix[1] に設定する

    3. targetMatrix[2] = rotationMatrix[2] に設定する

    4. targetMatrix[3] = rotationMatrix[3] に設定する

    5. targetMatrix[4] = rotationMatrix[4] に設定する

    6. targetMatrix[5] = rotationMatrix[5] に設定する

    7. targetMatrix[6] = rotationMatrix[6] に設定する

    8. targetMatrix[7] = rotationMatrix[7] に設定する

    9. targetMatrix[8] = rotationMatrix[8] に設定する

    10. targetMatrix[9] = rotationMatrix[9] に設定する

    11. targetMatrix[10] = rotationMatrix[10] に設定する

    12. targetMatrix[11] = rotationMatrix[11] に設定する

    13. targetMatrix[12] = rotationMatrix[12] に設定する

    14. targetMatrix[13] = rotationMatrix[13] に設定する

    15. targetMatrix[14] = rotationMatrix[14] に設定する

    16. targetMatrix[15] = rotationMatrix[15] に設定する

  6. targetMatrixDOMMatrix 型である場合、次のサブ手順を実行する:

    1. targetMatrix.m11 = rotationMatrix[0] に設定する

    2. targetMatrix.m12 = rotationMatrix[1] に設定する

    3. targetMatrix.m13 = rotationMatrix[2] に設定する

    4. targetMatrix.m14 = rotationMatrix[3] に設定する

    5. targetMatrix.m21 = rotationMatrix[4] に設定する

    6. targetMatrix.m22 = rotationMatrix[5] に設定する

    7. targetMatrix.m23 = rotationMatrix[6] に設定する

    8. targetMatrix.m24 = rotationMatrix[7] に設定する

    9. targetMatrix.m31 = rotationMatrix[8] に設定する

    10. targetMatrix.m32 = rotationMatrix[9] に設定する

    11. targetMatrix.m33 = rotationMatrix[10] に設定する

    12. targetMatrix.m34 = rotationMatrix[11] に設定する

    13. targetMatrix.m41 = rotationMatrix[12] に設定する

    14. targetMatrix.m42 = rotationMatrix[13] に設定する

    15. targetMatrix.m43 = rotationMatrix[14] に設定する

    16. targetMatrix.m44 = rotationMatrix[15] に設定する

6.2. AbsoluteOrientationSensor インターフェイス

[SecureContext, Exposed=Window]
interface AbsoluteOrientationSensor : OrientationSensor {
  constructor(optional OrientationSensorOptions sensorOptions = {});
};

AbsoluteOrientationSensor オブジェクトを構築するために、ユーザーエージェントは AbsoluteOrientationSensor インターフェイスについて 方位センサーオブジェクトを構築する抽象操作を 呼び出さなければならない。

AbsoluteOrientationSensorサポートされるセンサーオプションは、 "frequency" および "referenceFrame" である。

6.3. RelativeOrientationSensor インターフェイス

[SecureContext, Exposed=Window]
interface RelativeOrientationSensor : OrientationSensor {
  constructor(optional OrientationSensorOptions sensorOptions = {});
};

RelativeOrientationSensor オブジェクトを構築するために、ユーザーエージェントは RelativeOrientationSensor インターフェイスについて 方位センサーオブジェクトを構築する抽象操作を 呼び出さなければならない。

RelativeOrientationSensorサポートされるセンサーオプションは、 "frequency" および "referenceFrame" である。

7. 抽象操作

7.1. Orientation Sensor オブジェクトを構築する

入力

orientation_interface、その継承インターフェイスOrientationSensor を含む、インターフェイス 識別子

optionsOrientationSensorOptions オブジェクト。

出力

OrientationSensor オブジェクト。

  1. allowed を、orientation_interface により識別される インターフェイスを用いて センサーのポリシー制御機能を確認するを 呼び出した結果とする。

  2. allowed が false の場合、次を実行する:

    1. SecurityError DOMException投げる

  3. orientation を、orientation_interface により識別される インターフェイスの新しいインスタンスとする。

  4. orientation および options を用いて センサーオブジェクトを初期化するを 呼び出す。

  5. options.referenceFrame が "screen" である場合、次を実行する:

    1. orientationローカル座標系を、 スクリーン座標系として定義する。

  6. そうでなければ、orientationローカル座標系を、 デバイス座標系として定義する。

  7. orientation を返す。

7.2. クォータニオンを回転行列に変換する

クォータニオンを回転行列に変換する アルゴリズムは、以下に示すように、クォータニオン [QUATCONV] から変換された 列優先順の回転行列の リスト表現を作成する:

Converting quaternion to rotation matrix.

ここで:

x、数 y、数 z、および数 w が与えられたとき、クォータニオンを回転 行列に変換するには:
  1. m11 を 1 - 2 * y * y - 2 * z * z とする

  2. m12 を 2 * x * y - 2 * z * w とする

  3. m13 を 2 * x * z + 2 * y * w とする

  4. m14 を 0 とする

  5. m21 を 2 * x * y + 2 * z * w とする

  6. m22 を 1 - 2 * x * x - 2 * z * z とする

  7. m23 を 2 * y * z - 2 * x * w とする

  8. m24 を 0 とする

  9. m31 を 2 * x * z - 2 * y * w とする

  10. m32 を 2 * y * z + 2 * x * w とする

  11. m33 を 1 - 2 * x * x - 2 * y * y とする

  12. m34 を 0 とする

  13. m41 を 0 とする

  14. m42 を 0 とする

  15. m43 を 0 とする

  16. m44 を 1 とする

  17. « m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34, m41, m42, m43, m44 » を返す。

7.3. オイラー角からクォータニオンを作成する

alpha、数 beta、および数 gamma が与えられたとき、 オイラー角からクォータニオンを作成するには:

  1. alphaInRadians を、alpha を度からラジアンに変換したものとする。

  2. betaInRadians を、beta を度からラジアンに変換したものとする。

  3. gammaInRadians を、gamma を度からラジアンに変換したものとする。

  4. cosZ を (0.5 * alphaInRadians) の余弦とする。

  5. sinZ を (0.5 * alphaInRadians) の正弦とする。

  6. cosX を (0.5 * betaInRadians) の余弦とする。

  7. sinX を (0.5 * betaInRadians) の正弦とする。

  8. cosY を (0.5 * gammaInRadians) の余弦とする。

  9. sinY を (0.5 * gammaInRadians) の正弦とする。

  10. quaternionX を (sinX * cosY * cosZ - cosX * sinY * sinZ) とする。

  11. quaternionY を (cosX * sinY * cosZ + sinX * cosY * sinZ) とする。

  12. quaternionZ を (cosX * cosY * sinZ + sinX * sinY * cosZ) とする。

  13. quaternionW を (cosX * cosY * cosZ - sinX * sinY * sinZ) とする。

  14. « quaternionX, quaternionY, quaternionZ, quaternionW » を返す。

8. 自動化

この節は、Generic Sensor API § 9 Automation を、Orientation Sensor 固有の仮想センサーメタデータを提供することで拡張する。

8.1. 他の仕様への変更

この仕様は、Device Orientation and Motion § automation と次のように統合する。

方位データ読み取り値を解析するアルゴリズムは、次のように 変更される:

注記: この仕様は現在、 WebDriver でクォータニオンを直接指定する(そしてその結果としてクォータニオンからオイラー角を導出する) 方法を提供していない。この決定は、単純さのため、および自動化ユーザーは入力として オイラー角を扱う(または特定のクォータニオン値を選び、対応するオイラー角値を自分で提供する) 可能性がはるかに高いという前提のもとで行われた。クォータニオン値を直接提供できることに 関心を持つ、異なるユースケースのユーザーからのフィードバックは、この仕様の課題トラッカーを通じて歓迎される。

8.2. Absolute Orientation Sensor の自動化

absolute-orientation 仮想センサー型と、 型ごとの仮想センサーメタデータ マップ内の 対応するエントリーは、Device Orientation and Motion § automation で定義される。

8.3. Relative Orientation Sensor の自動化

relative-orientation 仮想センサー型と、 型ごとの仮想センサーメタデータ マップ内の 対応するエントリーは、Device Orientation and Motion § automation で定義される。

9. 謝辞

Generic Sensor API への取り組みについて Tobie Langel に感謝する。

適合性

文書の 慣例

適合性要件は、記述的な表明 と RFC 2119 の用語を組み合わせて 表現される。 この文書の規範的な部分におけるキーワード “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, および “OPTIONAL” は、RFC 2119 で説明されているように 解釈されるものとする。 ただし、読みやすさのため、 これらの語はこの仕様ではすべて大文字で現れるわけではない。

この仕様のすべてのテキストは規範的である。 ただし、明示的に非規範的と印付けされた節、例、および注記を除く。 [RFC2119]

この仕様における例は、“for example” という語で導入されるか、 規範的テキストから class="example" により 分離される。次のように:

これは参考情報としての例の一例である。

参考情報としての注記は “Note” という語で始まり、 規範的テキストから class="note" により 分離される。次のように:

注記、これは参考情報としての注記である。

適合する アルゴリズム

アルゴリズムの一部として命令形で表現された要件 (たとえば "strip any leading space characters" や "return false and abort these steps" など)は、 そのアルゴリズムを導入する際に用いられた キーワード("must", "should", "may" など) の意味で解釈されるものとする。

アルゴリズムまたは特定の手順として表現された適合性要件は、 最終結果が同等である限り、 どのような方法で実装されてもよい。 特に、この仕様で定義されるアルゴリズムは 理解しやすいことを意図しており、 高性能であることを意図していない。 実装者には最適化が奨励される。

索引

この仕様で定義される用語

参照により定義される用語

参考文献

規範的参考文献

[ACCELEROMETER]
Anssi Kostiainen. Accelerometer. 2026年5月14日. CRD. URL: https://www.w3.org/TR/accelerometer/
[GENERIC-SENSOR]
Rick Waldron. Generic Sensor API. 2026年5月14日. CRD. URL: https://www.w3.org/TR/generic-sensor/
[GEOMETRY-1]
Sebastian Zartner; Yehonatan Daniv. Geometry Interfaces Module Level 1. 2025年12月4日. CRD. URL: https://www.w3.org/TR/geometry-1/
[GYROSCOPE]
Anssi Kostiainen. Gyroscope. 2026年5月14日. CRD. URL: https://www.w3.org/TR/gyroscope/
[INFRA]
Anne van Kesteren; Domenic Denicola. Infra Standard. Living Standard. URL: https://infra.spec.whatwg.org/
[MAGNETOMETER]
Anssi Kostiainen; Rijubrata Bhaumik. Magnetometer. 2026年5月14日. WD. URL: https://www.w3.org/TR/magnetometer/
[MOTION-SENSORS]
Kenneth Christiansen; Alexander Shalamov. Motion Sensors Explainer. 2017年8月30日. NOTE. URL: https://www.w3.org/TR/motion-sensors/
[ORIENTATION-EVENT]
Reilly Grant; Marcos Caceres. Device Orientation and Motion. 2025年2月12日. CRD. URL: https://www.w3.org/TR/orientation-event/
[PERMISSIONS-POLICY-1]
Ian Clelland. Permissions Policy. 2025年10月6日. WD. URL: https://www.w3.org/TR/permissions-policy-1/
[RFC2119]
S. Bradner. RFC において要求レベルを 示すために用いるキーワード. 1997年3月. Best Current Practice. URL: https://datatracker.ietf.org/doc/html/rfc2119
[WEBIDL]
Edgar Chen; Timothy Gu. Web IDL Standard. Living Standard. URL: https://webidl.spec.whatwg.org/

非規範的参考文献

[HTML]
Anne van Kesteren; et al. HTML Standard. Living Standard. URL: https://html.spec.whatwg.org/multipage/
[QUATCONV]
Watt, Alan H., and Mark Watt.. Advanced animation and rendering techniques., page 362. 1992. 参考情報. URL: https://www.cs.cmu.edu/afs/cs/academic/class/15462-s14/www/lec_slides/3DRotationNotes.pdf
[QUATERNIONS]
Quaternion. URL: https://en.wikipedia.org/wiki/Quaternion
[SI]
SI Brochure: The International System of Units (SI), 8th edition. 2014. 第8版. URL: http://www.bipm.org/en/publications/si-brochure/

IDL 索引

typedef (Float32Array or Float64Array or DOMMatrix) RotationMatrixType;

[SecureContext, Exposed=Window]
interface OrientationSensor : Sensor {
  readonly attribute FrozenArray<double>? quaternion;
  undefined populateMatrix(RotationMatrixType targetMatrix);
};

enum OrientationSensorLocalCoordinateSystem { "device", "screen" };

dictionary OrientationSensorOptions : SensorOptions {
  OrientationSensorLocalCoordinateSystem referenceFrame = "device";
};

[SecureContext, Exposed=Window]
interface AbsoluteOrientationSensor : OrientationSensor {
  constructor(optional OrientationSensorOptions sensorOptions = {});
};

[SecureContext, Exposed=Window]
interface RelativeOrientationSensor : OrientationSensor {
  constructor(optional OrientationSensorOptions sensorOptions = {});
};

MDN

AbsoluteOrientationSensor/AbsoluteOrientationSensor

In only one current engine.

FirefoxNoneSafariNoneChrome67+
Opera?Edge79+
Edge (Legacy)?IENone
Firefox for Android?iOS Safari?Chrome for Android?Android WebView?Samsung Internet?Opera Mobile?
MDN

AbsoluteOrientationSensor

In only one current engine.

FirefoxNoneSafariNoneChrome67+
Opera?Edge79+
Edge (Legacy)?IENone
Firefox for Android?iOS Safari?Chrome for Android?Android WebView?Samsung Internet?Opera Mobile?
MDN

OrientationSensor/populateMatrix

In only one current engine.

FirefoxNoneSafariNoneChrome67+
Opera?Edge79+
Edge (Legacy)?IENone
Firefox for Android?iOS Safari?Chrome for Android?Android WebView?Samsung Internet?Opera Mobile?
MDN

OrientationSensor/quaternion

In only one current engine.

FirefoxNoneSafariNoneChrome67+
Opera?Edge79+
Edge (Legacy)?IENone
Firefox for Android?iOS Safari?Chrome for Android?Android WebView?Samsung Internet?Opera Mobile?
MDN

OrientationSensor

In only one current engine.

FirefoxNoneSafariNoneChrome67+
Opera?Edge79+
Edge (Legacy)?IENone
Firefox for Android?iOS Safari?Chrome for Android?Android WebView?Samsung Internet?Opera Mobile?
MDN

RelativeOrientationSensor/RelativeOrientationSensor

In only one current engine.

FirefoxNoneSafariNoneChrome67+
Opera?Edge79+
Edge (Legacy)?IENone
Firefox for Android?iOS Safari?Chrome for Android?Android WebView?Samsung Internet?Opera Mobile?
MDN

RelativeOrientationSensor

In only one current engine.

FirefoxNoneSafariNoneChrome67+
Opera?Edge79+
Edge (Legacy)?IENone
Firefox for Android?iOS Safari?Chrome for Android?Android WebView?Samsung Internet?Opera Mobile?