DeviceMotionEvent.accelerationIncludingGravity

  • Revision slug: DOM/DeviceMotionEvent.accelerationIncludingGravity
  • Revision title: DeviceMotionEvent.accelerationIncludingGravity
  • Revision id: 70556
  • Created:
  • Creator: Sheppy
  • Is current revision? No
  • Comment new page for bug 662678; page created, 116 words added

Revision Content

{{ DomRef() }}

Summary

Returns the amount of acceleration recorded by the device, in meters per second squared. Unlike {{ domxref("DeviceMotionEvent.acceleration") }}, this property's value does not compensate for the influence of gravity; instead, its value is the sum of the acceleration of the device as induced by the user and the acceleration caused by gravity.

This value is not typically as useful as {{ domxref("DeviceMotionEvent.acceleration") }}, but may be the only value available on devices that aren't capable of removing gravity from the acceleration data, such as on devices that don't have a gyroscope.

Syntax

var acceleration = motionEvent.accelerationIncludingGravity;

Example

Specification

See also

Revision Source

<p>{{ DomRef() }}</p>
<h3 id="Summary" name="Summary">Summary</h3>
<p>Returns the amount of acceleration recorded by the device, in meters per second squared. Unlike {{ domxref("DeviceMotionEvent.acceleration") }}, this property's value does not compensate for the influence of gravity; instead, its value is the sum of the acceleration of the device as induced by the user and the acceleration caused by gravity.</p>
<p>This value is not typically as useful as {{ domxref("DeviceMotionEvent.acceleration") }}, but may be the only value available on devices that aren't capable of removing gravity from the acceleration data, such as on devices that don't have a gyroscope.</p>
<h3 id="Syntax" name="Syntax">Syntax</h3>
<pre class="eval"><em>var acceleration</em> = <em>motionEvent</em>.accelerationIncludingGravity;
</pre>
<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