public class Interpolation extends Object
Constructor and Description |
---|
Interpolation() |
Modifier and Type | Method and Description |
---|---|
static double |
bicubicInterp(double x,
double y,
double[][] p)
Bicubic interpolation of the value at x,y where 0<=x<=1 and 0<=y<=1 given
the values at integer coordinates from (-1,-1) to (3,3).
|
static float |
bicubicInterp(float x,
float y,
float[][] p)
Bicubic interpolation of the value at x,y where 0<=x<=1 and 0<=y<=1 given
the values at integer coordinates from (-1,-1) to (3,3).
|
static double |
bilerp(double x,
double y,
double f00,
double f01,
double f10,
double f11)
Bilinear interpolation of the value at x,y where 0<=x<=1 and 0<=y<=1
given the values at (0,0), (0,1), (1,0) and (1,1).
|
static float |
bilerp(float x,
float y,
float f00,
float f01,
float f10,
float f11)
Bilinear interpolation of the value at x,y where 0<=x<=1 and 0<=y<=1
given the values at (0,0), (0,1), (1,0) and (1,1).
|
static float |
bilerpf(float x,
float y,
float f00,
float f01,
float f10,
float f11)
Bilinear interpolation of the value at x,y where 0<=x<=1 and 0<=y<=1
given the values at (0,0), (0,1), (1,0) and (1,1).
|
static double |
cubicInterp(double x,
double[] y)
Cubic interpolation of y at x (in 0..1) given y at x=[-1, 0, 1, 2]
|
static double |
cubicInterp(double x,
double y0,
double y1,
double y2,
double y3)
Cubic interpolation of y at x (in 0..1) given y at x=[-1, 0, 1, 2]
|
static float |
cubicInterp(float x,
float[] y)
Cubic interpolation of y at x (in 0..1) given y at x=[-1, 0, 1, 2]
|
static float |
cubicInterp(float x,
float y0,
float y1,
float y2,
float y3)
Cubic interpolation of y at x (in 0..1) given y at x=[-1, 0, 1, 2]
|
static double |
lerp(double x,
double x0,
double y0,
double x1,
double y1)
Linear interpolation of y at x given x0,y0 and x1,y1.
|
static float |
lerp(float x,
float x0,
float y0,
float x1,
float y1)
Linear interpolation of y at x given x0,y0 and x1,y1.
|
public Interpolation()
public static float lerp(float x, float x0, float y0, float x1, float y1)
x
- the x positionx0
- the first x positiony0
- the first y positionx1
- the second x positiony1
- the second y positionpublic static double lerp(double x, double x0, double y0, double x1, double y1)
x
- the x positionx0
- the first x positiony0
- the first y positionx1
- the second x positiony1
- the second y positionpublic static double cubicInterp(double x, double y0, double y1, double y2, double y3)
x
- the x value to computey0
- y value at x=-1y1
- y value at x=0y2
- y value at x=1y3
- y value at x=2public static float cubicInterp(float x, float y0, float y1, float y2, float y3)
x
- the x value to computey0
- y value at x=-1y1
- y value at x=0y2
- y value at x=1y3
- y value at x=2public static double cubicInterp(double x, double[] y)
x
- the x value to computey
- an array of 4 y values at x=[-1, 0, 1, 2]public static float cubicInterp(float x, float[] y)
x
- the x value to computey
- an array of 4 y values at x=[-1, 0, 1, 2]public static double bilerp(double x, double y, double f00, double f01, double f10, double f11)
x
- the x position (in 0..1)y
- the y position (in 0..1)f00
- the value at (0,0)f01
- the value at (0,1)f10
- the value at (1,0)f11
- the value at (1,1)public static float bilerpf(float x, float y, float f00, float f01, float f10, float f11)
x
- the x position (in 0..1)y
- the y position (in 0..1)f00
- the value at (0,0)f01
- the value at (0,1)f10
- the value at (1,0)f11
- the value at (1,1)public static float bilerp(float x, float y, float f00, float f01, float f10, float f11)
x
- the x position (in 0..1)y
- the y position (in 0..1)f00
- the value at (0,0)f01
- the value at (0,1)f10
- the value at (1,0)f11
- the value at (1,1)public static double bicubicInterp(double x, double y, double[][] p)
x
- the x position (in 0..1)y
- the y position (in 0..1)p
- a 4x4 array of known values at (-1,-1) to (3,3)public static float bicubicInterp(float x, float y, float[][] p)
x
- the x position (in 0..1)y
- the y position (in 0..1)p
- a 4x4 array of known values at (-1,-1) to (3,3)