Gyroscope Class

The gyroscope (https://w3c.github.io/gyroscope/#gyroscope-interface): the angular velocity of the device around its axes, in rad/s (rounded to 0.1 deg/s, as Chromium). It reads the DeviceSensorType.Gyroscope sensor of the device, and needs the gyroscope permission and permissions policy feature.

public sealed class Gyroscope : Sensor
Inheritance
Sensor Gyroscope

Constructors

NameDescription
Gyroscope(GyroscopeSensorOptions?)Creates a gyroscope. Throws a SecurityError DomException when the document is not allowed to use the gyroscope feature.

Gyroscope(GyroscopeSensorOptions?)

MotionSensors.cs

Creates a gyroscope. Throws a SecurityError DomException when the document is not allowed to use the gyroscope feature.

public Gyroscope(GyroscopeSensorOptions? sensorOptions = null)

Properties

NameDescription
XGets the angular velocity around the X axis, or null.
YGets the angular velocity around the Y axis, or null.
ZGets the angular velocity around the Z axis, or null.

Gets the angular velocity around the X axis, or null.

public double? X { get; }

Gets the angular velocity around the Y axis, or null.

public double? Y { get; }

Gets the angular velocity around the Z axis, or null.

public double? Z { get; }