Class LinearInterpolation
- java.lang.Object
-
- dev.nm.analysis.curvefit.interpolation.univariate.LinearInterpolation
-
- All Implemented Interfaces:
CurveFitting
,Interpolation
public class LinearInterpolation extends Object implements Interpolation
(Piecewise-)Linear interpolation fits a curve by interpolating linearly between two adjacent data-points. For points on the curve which lie outside the data, the nearest segment is used (for extrapolation).- See Also:
- Wikipedia: Linear Interpolation
-
-
Constructor Summary
Constructors Constructor Description LinearInterpolation()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description UnivariateRealFunction
fit(OrderedPairs f)
Fit a real valued function from a discrete set of data points.
-
-
-
Method Detail
-
fit
public UnivariateRealFunction fit(OrderedPairs f)
Description copied from interface:Interpolation
Fit a real valued function from a discrete set of data points. The interpolated function must pass through all the given points.- Specified by:
fit
in interfaceCurveFitting
- Specified by:
fit
in interfaceInterpolation
- Parameters:
f
- a discrete set of data points- Returns:
- the interpolated function
-
-