PHP Класс MathPHP\NumericalAnalysis\Interpolation\NewtonPolynomialForward
Newton Polynomials are used for polynomial interpolation.
Newton (Forward) Interpolting Polynomial belongs to a class of techniques called
Newton Polynomials. These techniques are used to generate an interpolating
polynomial for a given set of points (or a function). We can either directly
supply a set of inputs and their corresponding outputs for said function, or
if we explicitly know the function, we can define it as a callback function
and then generate a set of points by evaluating that function at n points
between a start and end point. We then use these values to interpolate a
Lagrange polynomial.
https://en.wikipedia.org/wiki/Newton_polynomial
Показать файл
Открыть проект
Открытые методы
Описание методов
interpolate()
публичный статический Метод
public static interpolate ( $source, $args ) : callable |
$source |
|
The source of our approximation. Should be either
a callback function or a set of arrays. Each array
(point) contains precisely two numbers, an x and y.
Example array: [[1,2], [2,3], [3,4]].
Example callback: function($x) {return $x**2;} |
Результат |
callable |
The interpolating polynomial p(x) |