Class BilinearInterpolation

java.lang.Object
smile.interpolation.BilinearInterpolation
All Implemented Interfaces:
Serializable, Interpolation2D

public class BilinearInterpolation extends Object implements Interpolation2D
Bilinear interpolation in a two-dimensional regular grid. Bilinear interpolation is an extension of linear interpolation for interpolating functions of two variables on a regular grid. The key idea is to perform linear interpolation first in one direction, and then again in the other direction.
See Also:
  • Constructor Details

    • BilinearInterpolation

      public BilinearInterpolation(double[] x1, double[] x2, double[][] y)
      Constructor.
      Parameters:
      x1 - the 1st dimension value.
      x2 - the 2nd dimension value.
      y - the function values at (x1, x2).
  • Method Details

    • interpolate

      public double interpolate(double x1, double x2)
      Description copied from interface: Interpolation2D
      Interpolate the data at a given 2-dimensional point.
      Specified by:
      interpolate in interface Interpolation2D
      Parameters:
      x1 - the 1st dimension value.
      x2 - the 2nd dimension value.
      Returns:
      the interpolated function value.
    • toString

      public String toString()
      Overrides:
      toString in class Object