public class IntegralCalculator
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
double |
accumulator
Present value of the accumulator.
|
Constructor and Description |
---|
IntegralCalculator(int choice_in)
Initalizes everything needed for an integral calculation.
|
Modifier and Type | Method and Description |
---|---|
double |
calcIntegral(double in)
Perform numerical integration by accounting for a new sample, and returning the present
integral value.
|
void |
resetIntegral()
Resets the present value of the integral to zero.
|
public double accumulator
public IntegralCalculator(int choice_in)
choice_in
- An integer between 0 and 4 inclusive to indicate the type of integration to
do.public double calcIntegral(double in)
in
- New sample from this control loop to add to the integral calculationpublic void resetIntegral()