java.lang.Object
com.gluonhq.attach.accelerometer.Acceleration

public class Acceleration extends Object
Represents a reading taken from the AccelerometerService. By using a device's accelerometer the acceleration force in three physical axes can be determined.
Since:
3.0.0
See Also:
  • Constructor Details

    • Acceleration

      public Acceleration(double x, double y, double z, LocalDateTime timestamp)
      Creates a new immutable Acceleration instance with the given x, y, z, and timestamp values.
      Parameters:
      x - The x value of the reading
      y - The y value of the reading
      z - The z value of the reading
      timestamp - The instant at which the reading took place
  • Method Details

    • getX

      public double getX()
      Returns the x value of the reading.
      Returns:
      The x value of the reading.
    • getY

      public double getY()
      Returns the y value of the reading
      Returns:
      The y value of the reading.
    • getZ

      public double getZ()
      Returns the z value of the reading
      Returns:
      The z value of the reading.
    • getTimestamp

      public LocalDateTime getTimestamp()
      Returns the timestamp of the reading
      Returns:
      The timestamp of the reading.