toxi.math
Class Interpolation2D

java.lang.Object
  extended by toxi.math.Interpolation2D

public class Interpolation2D
extends java.lang.Object

Implementations of 2D interpolation functions (currently only bilinear).


Constructor Summary
Interpolation2D()
           
 
Method Summary
static float bilinear(double x, double y, double x1, double y1, double x2, double y2, float tl, float tr, float bl, float br)
           
static float bilinear(Vec2D p, Vec2D p1, Vec2D p2, float tl, float tr, float bl, float br)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Interpolation2D

public Interpolation2D()
Method Detail

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