Class NewtonPolynomial
- java.lang.Object
-
- dev.nm.analysis.curvefit.interpolation.univariate.NewtonPolynomial
-
- All Implemented Interfaces:
CurveFitting
,Interpolation
public class NewtonPolynomial extends Object implements Interpolation
Newton polynomial is the interpolation polynomial for a given set of data points in the Newton form. Given a set of (k+1) data points \[ (x_0, y_0),\ldots,(x_k, y_k), \] the Newton form can be written as \[ N(x) = [y_0] + [y_0,y_1](x-x_0) + \cdots + [y_0,\ldots,y_k](x-x_0)(x-x_1)\cdots(x-x_{k-1}) \] where \([y_0,\ldots,y_j]\) is the notation for divided differences.- See Also:
- Wikipedia: Newton polynomial
-
-
Constructor Summary
Constructors Constructor Description NewtonPolynomial()
-
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
-
-