DeviceMotionEvent.rotationRate

  • Revision slug: DOM/DeviceMotionEvent.rotationRate
  • Revision title: DeviceMotionEvent.rotationRate
  • Revision id: 70553
  • Created:
  • Creator: Sheppy
  • Is current revision? No
  • Comment page created, 79 words added

Revision Content

{{ DomRef() }}

Summary

Returns the rate at which the device is rotating around each of its axes.

Syntax

var rates = motionEvent.rotationRate;

On return, rates is a {{ domxref("RotationRate") }} object describing the rotation rates of the device around each of its axes; each rate is specified in degrees per second.

Note: If the hardware isn't capable of providing this information, this property returns null.

Example

Specification

See also

Revision Source

<p>{{ DomRef() }}</p>
<h3 id="Summary" name="Summary">Summary</h3>
<p>Returns the rate at which the device is rotating around each of its axes.</p>
<h3 id="Syntax" name="Syntax">Syntax</h3>
<pre class="eval"><em>var rates</em> = <em>motionEvent</em>.rotationRate;
</pre>
<p>On return, <code>rates</code> is a {{ domxref("RotationRate") }} object describing the rotation rates of the device around each of its axes; each rate is specified in degrees per second.</p>
<div class="note"><strong>Note</strong>: If the hardware isn't capable of providing this information, this property returns <code>null</code>.</div>
<h3 id="Example" name="Example">Example</h3>
<h3 id="Specification" name="Specification">Specification</h3>
<ul> <li><a class="external" href="http://www.w3.org/TR/orientation-event/" title="http://www.w3.org/TR/orientation-event/">DeviceOrientation Event Specification</a></li>
</ul>
<h3 id="See_also">See also</h3>
<ul> <li>{{ domxref("DeviceMotionEvent") }}</li> <li><a href="/en/Detecting_device_orientation" title="Detecting device orientation">Detecting device orientation</a></li> <li>{{ domxref("window.ondevicemotion") }}</li>
</ul>
Revert to this revision