diff --git a/src/Numerics/Interpolate.cs b/src/Numerics/Interpolate.cs index cc2ec45e..50db7a0d 100644 --- a/src/Numerics/Interpolate.cs +++ b/src/Numerics/Interpolate.cs @@ -102,6 +102,23 @@ namespace MathNet.Numerics return Interpolation.Barycentric.InterpolatePolynomialEquidistant(points, values); } + /// + /// Create a neville polynomial interpolation based on arbitrary points. + /// If the points happen to be equidistant, consider to use the much more robust PolynomialEquidistant instead. + /// Otherwise, consider whether RationalWithoutPoles would not be a more robust alternative. + /// + /// The sample points t. Supports both lists and arrays. + /// The sample point values x(t). Supports both lists and arrays. + /// + /// An interpolation scheme optimized for the given sample points and values, + /// which can then be used to compute interpolations and extrapolations + /// on arbitrary points. + /// + public static IInterpolation Polynomial(IList points, IList values) + { + return new NevillePolynomialInterpolation(points, values); + } + /// /// Create a piecewise linear spline interpolation based on arbitrary points. /// @@ -121,6 +138,25 @@ namespace MathNet.Numerics return Interpolation.LinearSpline.Interpolate(points, values); } + /// + /// Create an piecewise cubic spline interpolation based on arbitrary points, with zero secondary derivatives at the boundaries. + /// + /// The sample points t. Optimized for arrays. + /// The sample point values x(t). Optimized for arrays. + /// + /// An interpolation scheme optimized for the given sample points and values, + /// which can then be used to compute interpolations and extrapolations + /// on arbitrary points. + /// + /// + /// The value pairs do not have to be sorted, but if they are not sorted ascendingly + /// and the passed x and y arguments are arrays, they will be sorted inplace and thus modified. + /// + public static IInterpolation CubicSpline(IEnumerable points, IEnumerable values) + { + return Interpolation.CubicSpline.Interpolate(points, values); + } + /// /// Create an piecewise cubic Akima spline interpolation based on arbitrary points. Akima splines are robust to outliers. ///