Class LinearArrayInterpolator
- java.lang.Object
-
- org.hortonmachine.gears.utils.math.interpolation.LinearArrayInterpolator
-
- All Implemented Interfaces:
Interpolator
public class LinearArrayInterpolator extends Object implements Interpolator
A class for doing linear interpolations on arrays of X and Y.- Author:
- Andrea Antonello (www.hydrologis.com)
-
-
Constructor Summary
Constructors Constructor Description LinearArrayInterpolator(double[] xList, double[] yList)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doublegetInterpolated(double x)Returns the interpolated value y=f(x).doublelinearInterpolateX(double yValue)A simple interpolation between existing numbers.doublelinearInterpolateY(double xValue)A simple interpolation between existing numbers.
-
-
-
Method Detail
-
linearInterpolateY
public double linearInterpolateY(double xValue)
A simple interpolation between existing numbers.- Parameters:
xValue- the value for which we want the y- Returns:
- the y value
-
linearInterpolateX
public double linearInterpolateX(double yValue)
A simple interpolation between existing numbers.- Parameters:
yValue- the value for which we want the x- Returns:
- the x value
-
getInterpolated
public double getInterpolated(double x)
Description copied from interface:InterpolatorReturns the interpolated value y=f(x).- Specified by:
getInterpolatedin interfaceInterpolator- Parameters:
x- the value of x.- Returns:
- the interpolated value of y.
-
-