Package org.opensourcephysics.numerics
Class Interpolation
java.lang.Object
org.opensourcephysics.numerics.Interpolation
Class Interpolation defines simple interpolation algorithms.
This class cannot be subclassed or instantiated because all methods are static.
- Author:
- Wolfgang Christian
-
Method Summary
-
Method Details
-
linear
public static double linear(double x, double x0, double x1, double y0, double y1) Linear interpolation at a single point x.- Parameters:
x
- doublex0
- doublex1
- doubley0
- doubley1
- double- Returns:
- double
-
lagrange
public static double lagrange(double x, double[] xd, double[] yd) Lagrange polynomial interpolation at a single point x. Because Lagrange polynomials tend to be ill behaved, this method should be used with care. A LagrangeInterpolator object should be used if multiple interpolations are to be performed using the same data.- Parameters:
x
- doublexd
- double[] the x datayd
- double[] the y data- Returns:
- double
-