Class SplineInterpolator


  • public class SplineInterpolator
    extends Object
    • Constructor Detail

      • SplineInterpolator

        public SplineInterpolator()
    • Method Detail

      • interpolate

        public static double interpolate​(double[] y,
                                         double deriv,
                                         double x_int)
        Calculates a spline interpolation at the location x_int. Simplified version of Numerical Recipes code, streamlined to process three points. X-locations are assumed to run 0 -> 2
        Parameters:
        y - vector of y-values
        deriv - second derivative at the center point
        x_int - x-position to interpolate
        Returns:
        the interpolated value
      • interpolate2d

        public static double interpolate2d​(double[] data,
                                           double[] derivatives,
                                           double x,
                                           double y)
      • interpolate2d

        public static double interpolate2d​(double[][] data,
                                           double x,
                                           double y)
      • interpolate

        public static double interpolate​(double[] x,
                                         double[] y,
                                         double[] deriv,
                                         double x_int)
        Calculates a spline interpolation at the location x_int. Coded from Numerical Recipes.
        Parameters:
        x - vector of x locations
        y - vextor of y-values
        deriv - vector of second derivatives at the sampling points
        x_int - x-position to interpolate
        Returns:
        the interpolated value