List of utility methods to do Linear Interpolate
double | linearInterpolation(double y2, double y1, double deltaX, double x1) Perform a linear interpolation calculation. return y2 - (y2 - y1) / deltaX * x1;
|
float | LinearInterpolation(float a, float b, float f) Calculates linear interpolation between values float possible = (a + b + f) / 3; if (Math.abs(possible) < 1) { return possible; } else { return 1; |
float | linearInterpolation(float min, float max, float min2, float max2, float value) linear Interpolation float range1 = max - min; float range2 = max2 - min2; return ((value - min) * range2 / range1) + min2; |
double | linearInterpReal(double dX, double[] dXCoordinate, double[] dYCoordinate) linear Interp Real if (dXCoordinate == null || dYCoordinate == null) return 0; if (dXCoordinate.length == 0 || dYCoordinate.length == 0 || dXCoordinate.length != dYCoordinate.length) throw new Exception("linearInterpReal: Lengths of passed in arrays are incorrect"); for (int iIndex = 0; iIndex < dXCoordinate.length; iIndex++) { if (dX <= dXCoordinate[iIndex]) { if (dX == dXCoordinate[iIndex]) return dYCoordinate[iIndex]; ... |