Class 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 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