Package toxi.math

Class Interpolation2D

java.lang.Object
toxi.math.Interpolation2D

public class Interpolation2D extends Object
Implementations of 2D interpolation functions (currently only bilinear).
  • Constructor Details

    • Interpolation2D

      public Interpolation2D()
  • Method Details

    • bilinear

      public static float bilinear(double x, double y, double x1, double y1, double x2, double y2, float tl, float tr, float bl, float br)
      Parameters:
      x - x coord of point to filter
      y - y coord of point to filter
      x1 - x coord of top-left corner
      y1 - y coord of top-left corner
      x2 - x coord of bottom-right corner
      y2 - y coord of bottom-right corner
      tl - top-left value
      tr - top-right value
      bl - bottom-left value
      br - bottom-right value
      Returns:
      interpolated value
    • bilinear

      public static float bilinear(Vec2D p, Vec2D p1, Vec2D p2, float tl, float tr, float bl, float br)
      Parameters:
      p - point to filter
      p1 - top-left corner
      p2 - bottom-right corner
      tl - top-left value
      tr - top-right value
      bl - bottom-left value
      br - bottom-right value
      Returns:
      interpolated value