Class PolynomialInterpolation

java.lang.Object
org.episteme.core.mathematics.analysis.interpolation.PolynomialInterpolation

public class PolynomialInterpolation extends Object
Polynomial interpolation methods.

Given points (x₀,y₀), (x₁,y₁), ..., (xₙ,yₙ), find polynomial P(x) such that P(xᵢ) = yᵢ.

Since:
1.0
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
  • Constructor Details

    • PolynomialInterpolation

      public PolynomialInterpolation()
  • Method Details

    • lagrange

      public static Function<Real,Real> lagrange(List<Real> xPoints, List<Real> yPoints)
      Lagrange interpolation polynomial.

      Constructs polynomial of degree ≤ n passing through n+1 points. Time complexity: O(n²) for evaluation.

      Parameters:
      xPoints - x-coordinates
      yPoints - y-coordinates (must have same length as xPoints)
      Returns:
      function that evaluates the interpolating polynomial
    • newton

      public static Function<Real,Real> newton(List<Real> xPoints, List<Real> yPoints)
      Newton divided differences interpolation.

      More efficient than Lagrange for adding new points incrementally. Uses divided differences table.

      Parameters:
      xPoints - x-coordinates
      yPoints - y-coordinates
      Returns:
      function that evaluates the interpolating polynomial
    • linearInterpolate

      public static Real linearInterpolate(Real x0, Real y0, Real x1, Real y1, Real x)
      Linear interpolation between two points.

      Simple and fast for piecewise linear approximation.

    • cubicSpline

      public static Function<Real,Real> cubicSpline(List<Real> xPoints, List<Real> yPoints)
      Cubic spline interpolation (natural boundary conditions).

      Produces smooth C² continuous curve through points.