Class TrilinearInterpolatingFunction

java.lang.Object
org.hipparchus.analysis.interpolation.TrilinearInterpolatingFunction
All Implemented Interfaces:
Serializable, FieldTrivariateFunction, TrivariateFunction

public class TrilinearInterpolatingFunction extends Object implements TrivariateFunction, FieldTrivariateFunction, Serializable
Interpolate grid data using tri-linear interpolation.

This interpolator is thread-safe.

Since:
4.1
See Also:
  • Constructor Details

    • TrilinearInterpolatingFunction

      public TrilinearInterpolatingFunction(double[] xVal, double[] yVal, double[] zVal, double[][][] fVal) throws MathIllegalArgumentException
      Simple constructor.
      Parameters:
      xVal - All the x-coordinates of the interpolation points, sorted in increasing order.
      yVal - All the y-coordinates of the interpolation points, sorted in increasing order.
      zVal - All the z-coordinates of the interpolation points, sorted in increasing order.
      fVal - The values of the interpolation points on all the grid knots: fVal[i][j][k] = f(xVal[i], yVal[j], zVal[k]).
      Throws:
      MathIllegalArgumentException - if grid size is smaller than 2 or if the grid is not sorted in strict increasing order
  • Method Details

    • getXInf

      public double getXInf()
      Get the lowest grid x coordinate.
      Returns:
      lowest grid x coordinate
    • getXSup

      public double getXSup()
      Get the highest grid x coordinate.
      Returns:
      highest grid x coordinate
    • getYInf

      public double getYInf()
      Get the lowest grid y coordinate.
      Returns:
      lowest grid y coordinate
    • getYSup

      public double getYSup()
      Get the highest grid y coordinate.
      Returns:
      highest grid y coordinate
    • getZInf

      public double getZInf()
      Get the lowest grid z coordinate.
      Returns:
      lowest grid z coordinate
    • getZSup

      public double getZSup()
      Get the highest grid z coordinate.
      Returns:
      highest grid z coordinate
    • value

      public double value(double x, double y, double z)
      Compute the value for the function.
      Specified by:
      value in interface TrivariateFunction
      Parameters:
      x - x-coordinate for which the function value should be computed.
      y - y-coordinate for which the function value should be computed.
      z - z-coordinate for which the function value should be computed.
      Returns:
      the value.
    • value

      public <T extends CalculusFieldElement<T>> T value(T x, T y, T z)
      Compute the value for the function.
      Specified by:
      value in interface FieldTrivariateFunction
      Type Parameters:
      T - type of the field elements
      Parameters:
      x - x-coordinate of the interpolation point.
      y - y-coordinate of the interpolation point.
      z - z-coordinate of the interpolation point.
      Returns:
      the value.
      Since:
      4.1