lejos.util
Class Integration
java.lang.Object
lejos.util.Integration
public class Integration
- extends Object
Integrate sensor measurement over time, e.g. to calculate velocity from acceleration
or angle from angular velocity.
- Author:
- Lawrie Griffiths
|
Constructor Summary |
Integration(double initialValue,
double reading)
Create the integration object with the initial value for the integral value
and the initial reading. |
|
Method Summary |
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 |
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 integralreading - the initial reading
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