Class GridSurfaceInterpolator

  • All Implemented Interfaces:
    SurfaceInterpolator, java.io.Serializable, Bean, ImmutableBean

    public final class GridSurfaceInterpolator
    extends java.lang.Object
    implements SurfaceInterpolator, ImmutableBean, java.io.Serializable
    A surface interpolator that is based on two curve interpolators.

    The surface parameters are divided into rows and columns based on the x-values and y-values. There must be at least two y-values for each x-value. In most cases, the parameters will form a rectangular grid.

    The interpolation operates in two stages. First, the parameters are grouped into sets, each with the same x value. Second, the y curve interpolator is used on each set of y values. Finally, the x curve interpolator is used on the results of the y interpolation.

    There should be at least two different y-values for each x-value. If there is only one, then the associated z-value will always be returned.

    See Also:
    Serialized Form
    • Method Detail

      • of

        public static GridSurfaceInterpolator of​(CurveInterpolator xInterpolator,
                                                 CurveInterpolator yInterpolator)
        Obtains an instance from the specified interpolators, using flat extrapolation.
        Parameters:
        xInterpolator - the x-value interpolator
        yInterpolator - the y-value interpolator
        Returns:
        the index
        Throws:
        java.lang.IllegalArgumentException - if the name is not known
      • of

        public static GridSurfaceInterpolator of​(CurveInterpolator xInterpolator,
                                                 CurveExtrapolator xExtrapolator,
                                                 CurveInterpolator yInterpolator,
                                                 CurveExtrapolator yExtrapolator)
        Obtains an instance from the specified interpolators and extrapolators.
        Parameters:
        xInterpolator - the x-value interpolator
        xExtrapolator - the x-value extrapolator
        yInterpolator - the y-value interpolator
        yExtrapolator - the y-value extrapolator
        Returns:
        the index
        Throws:
        java.lang.IllegalArgumentException - if the name is not known
      • of

        public static GridSurfaceInterpolator of​(CurveInterpolator xInterpolator,
                                                 CurveExtrapolator xExtrapolatorLeft,
                                                 CurveExtrapolator xExtrapolatorRight,
                                                 CurveInterpolator yInterpolator,
                                                 CurveExtrapolator yExtrapolatorLeft,
                                                 CurveExtrapolator yExtrapolatorRight)
        Obtains an instance from the specified interpolators and extrapolators.
        Parameters:
        xInterpolator - the x-value interpolator
        xExtrapolatorLeft - the x-value left extrapolator
        xExtrapolatorRight - the x-value right extrapolator
        yInterpolator - the y-value interpolator
        yExtrapolatorLeft - the y-value left extrapolator
        yExtrapolatorRight - the y-value right extrapolator
        Returns:
        the index
        Throws:
        java.lang.IllegalArgumentException - if the name is not known
      • bind

        public BoundSurfaceInterpolator bind​(DoubleArray xValues,
                                             DoubleArray yValues,
                                             DoubleArray zValues)
        Description copied from interface: SurfaceInterpolator
        Binds this interpolator to a surface.

        The bind process takes the definition of the interpolator and combines it with the x-y-z values. This allows implementations to optimize interpolation calculations.

        Specified by:
        bind in interface SurfaceInterpolator
        Parameters:
        xValues - the x-values of the surface, must be sorted from low to high
        yValues - the y-values of the surface, must be sorted from low to high within x
        zValues - the z-values of the surface
        Returns:
        the bound interpolator
      • getXInterpolator

        public CurveInterpolator getXInterpolator()
        Gets the x-value interpolator.
        Returns:
        the value of the property
      • getXExtrapolatorLeft

        public CurveExtrapolator getXExtrapolatorLeft()
        Gets the x-value left extrapolator.
        Returns:
        the value of the property
      • getXExtrapolatorRight

        public CurveExtrapolator getXExtrapolatorRight()
        Gets the x-value right extrapolator.
        Returns:
        the value of the property
      • getYInterpolator

        public CurveInterpolator getYInterpolator()
        Gets the y-value interpolator.
        Returns:
        the value of the property
      • getYExtrapolatorLeft

        public CurveExtrapolator getYExtrapolatorLeft()
        Gets the y-value left extrapolator.
        Returns:
        the value of the property
      • getYExtrapolatorRight

        public CurveExtrapolator getYExtrapolatorRight()
        Gets the y-value right extrapolator.
        Returns:
        the value of the property
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object