Class TricubicInterpolatingFunction

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

public class TricubicInterpolatingFunction extends Object implements TrivariateFunction, FieldTrivariateFunction
Function that implements the tricubic spline interpolation, as proposed in
Tricubic interpolation in three dimensions
F. Lekien and J. Marsden
Int. J. Numer. Meth. Eng 2005; 63:455-471
  • Constructor Details

    • TricubicInterpolatingFunction

      public TricubicInterpolatingFunction(double[] x, double[] y, double[] z, double[][][] f, double[][][] dFdX, double[][][] dFdY, double[][][] dFdZ, double[][][] d2FdXdY, double[][][] d2FdXdZ, double[][][] d2FdYdZ, double[][][] d3FdXdYdZ) throws MathIllegalArgumentException
      Simple constructor.
      Parameters:
      x - Sample values of the x-coordinate, in increasing order.
      y - Sample values of the y-coordinate, in increasing order.
      z - Sample values of the y-coordinate, in increasing order.
      f - Values of the function on every grid point.
      dFdX - Values of the partial derivative of function with respect to x on every grid point.
      dFdY - Values of the partial derivative of function with respect to y on every grid point.
      dFdZ - Values of the partial derivative of function with respect to z on every grid point.
      d2FdXdY - Values of the cross partial derivative of function on every grid point.
      d2FdXdZ - Values of the cross partial derivative of function on every grid point.
      d2FdYdZ - Values of the cross partial derivative of function on every grid point.
      d3FdXdYdZ - Values of the cross partial derivative of function on every grid point.
      Throws:
      MathIllegalArgumentException - if any of the arrays has zero length.
      MathIllegalArgumentException - if the various arrays do not contain the expected number of elements.
      MathIllegalArgumentException - if x, y or z are not strictly increasing.
  • Method Details

    • value

      public double value(double x, double y, double z) throws MathIllegalArgumentException
      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.
      Throws:
      MathIllegalArgumentException - if any of the variables is outside its interpolation range.
    • value

      public <T extends CalculusFieldElement<T>> T value(T x, T y, T z) throws MathIllegalArgumentException
      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.
      Throws:
      MathIllegalArgumentException - if any of the variables is outside its interpolation range.
      Since:
      4.1
    • isValidPoint

      public boolean isValidPoint(double x, double y, double z)
      Indicates whether a point is within the interpolation range.
      Parameters:
      x - First coordinate.
      y - Second coordinate.
      z - Third coordinate.
      Returns:
      true if (x, y, z) is a valid point.