Back to Content

OrientationSensor: quaternion property

files/en-us/web/api/orientationsensor/quaternion/index.md

latest664 B
Original Source

{{securecontext_header}}{{APIRef("Sensor API")}}

The quaternion read-only property of the {{domxref("OrientationSensor")}} interface returns a four element {{jsxref('Array')}} whose elements contain the components of the unit {{Glossary("quaternion")}} representing the device's orientation.

Because {{domxref('OrientationSensor')}} is a base class, quaternion may only be read from one of its derived classes.

Value

An {{jsxref('Array')}} whose values are the x, y, z, and w components of the quaternion representing the device orientation.

Examples

js
// TBD

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}