Class LinearArrayInterpolator

  • All Implemented Interfaces:
    Interpolator

    public class LinearArrayInterpolator
    extends Object
    implements Interpolator
    A class for doing linear interpolations on arrays of X and Y.
    Author:
    Andrea Antonello (www.hydrologis.com)
    • Constructor Detail

      • LinearArrayInterpolator

        public LinearArrayInterpolator​(double[] xList,
                                       double[] yList)
    • Method Detail

      • linearInterpolateY

        public double linearInterpolateY​(double xValue)
        A simple interpolation between existing numbers.
        Parameters:
        xValue - the value for which we want the y
        Returns:
        the y value
      • linearInterpolateX

        public double linearInterpolateX​(double yValue)
        A simple interpolation between existing numbers.
        Parameters:
        yValue - the value for which we want the x
        Returns:
        the x value
      • getInterpolated

        public double getInterpolated​(double x)
        Description copied from interface: Interpolator
        Returns the interpolated value y=f(x).
        Specified by:
        getInterpolated in interface Interpolator
        Parameters:
        x - the value of x.
        Returns:
        the interpolated value of y.