Package lejos.utility

Class Integration


  • public class Integration
    extends java.lang.Object
    Integrate sensor measurement over time, e.g. to calculate velocity from acceleration or angle from angular velocity.
    Author:
    Lawrie Griffiths
    • Constructor Summary

      Constructors 
      Constructor Description
      Integration​(double initialValue, double reading)
      Create the integration object with the initial value for the integral value and the initial reading.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      double addReading​(double reading)
      Add a new reading and return the current integral
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Integration

        public Integration​(double initialValue,
                           double reading)
        Create the integration object with the initial value for the integral value and the initial reading.
        Parameters:
        initialValue - the initial value for the integral
        reading - the initial reading
    • Method Detail

      • addReading

        public double addReading​(double reading)
        Add a new reading and return the current integral
        Parameters:
        reading - the reading as a double
        Returns:
        the current value of the integral