# SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.analysis.curvefit.interpolation.univariate

## Class NewtonPolynomial

• java.lang.Object
• com.numericalmethod.suanshu.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.
Wikipedia: Newton polynomial
• ### Constructor Summary

Constructors
Constructor and Description
NewtonPolynomial()
• ### Method Summary

All Methods
Modifier and Type Method and Description
UnivariateRealFunction fit(OrderedPairs f)
Fit a real valued function from a discrete set of data points.
• ### Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
• ### Constructor Detail

• #### NewtonPolynomial

public NewtonPolynomial()
• ### 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 interface CurveFitting
Specified by:
fit in interface Interpolation
Parameters:
f - a discrete set of data points
Returns:
the interpolated function