Class Interpolation2D

java.lang.Object
org.episteme.core.mathematics.analysis.interpolation.Interpolation2D

public class Interpolation2D extends Object
2D Interpolation methods.

Methods for interpolating values on a 2D grid or scattered points.

Since:
1.0
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
  • Constructor Details

    • Interpolation2D

      public Interpolation2D()
  • Method Details

    • bilinear

      public static Real bilinear(Real x, Real y, Real v00, Real v10, Real v01, Real v11)
      Bilinear interpolation on a unit square.

      Interpolates value at (x, y) where 0 invalid input: '<'= x, y invalid input: '<'= 1. Values at corners: (0,0): v00 (1,0): v10 (0,1): v01 (1,1): v11

    • bilinear

      public static Real bilinear(Real x, Real y, Real x1, Real x2, Real y1, Real y2, Real q11, Real q21, Real q12, Real q22)
      Bilinear interpolation on an arbitrary rectangle.
      Parameters:
      x - target x coordinate
      y - target y coordinate
      x1 - left x coordinate
      x2 - right x coordinate
      y1 - bottom y coordinate
      y2 - top y coordinate
      q11 - value at (x1, y1)
      q21 - value at (x2, y1)
      q12 - value at (x1, y2)
      q22 - value at (x2, y2)
      Returns:
      interpolated value at (x, y)
    • bicubic

      public static Real bicubic(Real[][] p, Real x, Real y)
      Bicubic interpolation (simplified).

      Requires 16 points (4x4 grid) surrounding the target point. This implementation uses a simple convolution kernel (Catmull-Rom spline).

      Parameters:
      p - 4x4 array of values. p[1][1] is top-left of the central cell. p[i][j] is value at grid point (i-1, j-1) relative to cell origin.
      x - normalized x coordinate within the cell (0 to 1)
      y - normalized y coordinate within the cell (0 to 1)
      Returns:
      interpolated value