Class LinearInterpolation

  • All Implemented Interfaces:
    CurveFitting, Interpolation

    public class LinearInterpolation
    extends Object
    implements Interpolation
    (Piecewise-)Linear interpolation fits a curve by interpolating linearly between two adjacent data-points. For points on the curve which lie outside the data, the nearest segment is used (for extrapolation).
    See Also:
    Wikipedia: Linear Interpolation
    • Constructor Detail

      • LinearInterpolation

        public LinearInterpolation()
    • Method Detail

      • fit

        public UnivariateRealFunction fit​(OrderedPairs f)
        Description copied from interface: Interpolation
        Fit a real valued function from a discrete set of data points.

        The interpolated function must pass through all the given points.

        Specified by:
        fit in interface CurveFitting
        Specified by:
        fit in interface Interpolation
        Parameters:
        f - a discrete set of data points
        Returns:
        the interpolated function