PHP 클래스 MathPHP\NumericalAnalysis\Interpolation\NaturalCubicSpline

In numerical analysis, cubic splines are used for polynomial interpolation. A cubic spline is a spline constructed of piecewise third-order polynomials which pass through a set of m control points." In the case of the natural cubic spline, the second derivative of each polynomial is set to zero at the endpoints of each interval of the piecewise function. Cubic spline interpolation belongs to a collection of techniques that interpolate a function or a set of values, producing a continuous polynomial. In the case of the cubic spline, a piecewise function (polynomial) is produced. 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 our piecewise polynomial. https://en.wikipedia.org/wiki/Spline_interpolation http://mathworld.wolfram.com/CubicSpline.html
상속: extends Interpolation
파일 보기 프로젝트 열기: markrogoyski/math-php 1 사용 예제들

공개 메소드들

메소드 설명
interpolate ( $source, $args ) : Piecewise Interpolate

메소드 상세

interpolate() 공개 정적인 메소드

Interpolate
public static interpolate ( $source, $args ) : Piecewise
$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;}
리턴 MathPHP\Functions\Piecewise The interpolting (piecewise) polynomial, as an instance of Piecewise.