VOOZH about

URL: https://www.geeksforgeeks.org/javascript/p5-js-accelerationx-variable/

⇱ p5.js accelerationX variable - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

p5.js accelerationX variable

Last Updated : 10 May, 2021

The accelerationX system variable is responsible for the acceleration of the device(tablets or mobile phones) along the x-axis. It can be used with the draw() function to accelerate the device in the x-axis of the coordinate. 

Its value is represented as meters per second squared.

Syntax:

accelerationX

Example 1:

Output:

👁 Image

Example 2:

Output:

👁 Image
Comment