public class CurveInterpolation
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
private static interface |
CurveInterpolation.Get |
Modifier and Type | Field and Description |
---|---|
private static CurveInterpolation.Get |
getColumn |
private static CurveInterpolation.Get |
getSingle |
static float[][] |
points2Test
The xr or x1 values are given from -1, 2, 7 10 in the first row for columns.
|
static float[][] |
pointsTest |
static java.lang.String |
sVersion
Version, history and license.
|
private static int[] |
testIndex |
Constructor and Description |
---|
CurveInterpolation() |
Modifier and Type | Method and Description |
---|---|
static float |
linearInterpolation(float x,
float[][] points,
int ixstart) |
static float |
linearInterpolation(float xr,
float xc,
float[][] points,
int ixstart)
xc1 xc xc2
xr1 y1 yc1 yc2 ------dc1
xr y
xr2 yr2 ycr2 y2 ------dc2
|
static float[][] |
pointsTest() |
private static int |
search(float x,
java.lang.Object points,
int from,
int to,
int ixstart,
CurveInterpolation.Get get)
Binary search of x in points[...][0]
|
static float |
splineInterpolation(float x,
float[][] points,
int ixstart)
This spline interpolation has the following propertied:
Any y-value in points is exactly represented by the associated x input.
|
static float |
splineInterpolation(float xr,
float xc,
float[][] points,
int ixstart) |
static float[][] |
test() |
static float[][] |
test2() |
public static final java.lang.String sVersion
private static CurveInterpolation.Get getColumn
private static CurveInterpolation.Get getSingle
public static float[][] pointsTest
private static int[] testIndex
public static float[][] points2Test
public static float linearInterpolation(float x, float[][] points, int ixstart)
public static float splineInterpolation(float x, float[][] points, int ixstart)
x
- inputpoints
- array of ordered pair of numbers. points[...][0] is the x value. points[...][1] is the associated y-value.
The x values have to be increasing.ixstart
- -1 if not used, possible index to enforce the search of x input in points. Result of #search(float, float[][], int)
.public static float linearInterpolation(float xr, float xc, float[][] points, int ixstart)
xc1 xc xc2 xr1 y1 yc1 yc2 ------dc1 xr y xr2 yr2 ycr2 y2 ------dc2
xr
- xc
- points
- ixstart
- public static float splineInterpolation(float xr, float xc, float[][] points, int ixstart)
private static int search(float x, java.lang.Object points, int from, int to, int ixstart, CurveInterpolation.Get get)
x
- points
- ixstart
- check whether x is in the correct segment, then fast return.public static float[][] pointsTest()
public static float[][] test()
public static float[][] test2()