GO-Ve01
ServicesDevelopersBooksDictionaryPapersWikidataEncyclopediaSearchBabelCareersDeck

DeviceMotionEvent: acceleration property

Device Orientation Events

Device Orientation Events

The **`acceleration`** read-only property of the DeviceMotionEvent interface returns the acceleration recorded by
the device, in [meters per second squared (m/s²)](https://en.wikipedia.org/wiki/Meter_per_second_squared).
This value does not include the effect of
the gravitational force, in contrast to DeviceMotionEvent.accelerationIncludingGravity.

> [!NOTE]
> If the hardware does not know how to remove gravity from the
> acceleration data, this value may not be present in the
> DeviceMotionEvent. In this situation, you'll need to use
> DeviceMotionEvent.accelerationIncludingGravity instead.

## Value

The `acceleration` property is an object providing information about
acceleration on the three axes in the [Device coordinate frame](/docs/Web/API/Device_orientation_events/Orientation_and_motion_data_explained#device_coordinate_frame). Each axis is represented with its own property:

- `x`
- : Represents the acceleration along the x axis
- `y`
- : Represents the acceleration along the y axis
- `z`
- : Represents the acceleration along the z axis

## Specifications

## Browser compatibility

## See also

- Detecting device orientation
- Orientation and motion data explained
- devicemotion event

source: MDN Web Docs mirror · page

Cite this

"DeviceMotionEvent: acceleration property". MDN Web Docs. CC BY-SA 2.5 (MDN). https://developer.mozilla.org/en-US/docs/Web/API/DeviceMotionEvent/acceleration

JSON record · API collection · BibTeX · RIS · CSL-JSON · citation policy

Save to pass ·