interpolateInternalSingleProc function

double interpolateInternalSingleProc(
  1. double value,
  2. double inS,
  3. double inE,
  4. double outS,
  5. double outE,
)

Implementation

double interpolateInternalSingleProc(
    double value, double inS, double inE, double outS, double outE) {
  double progress = (value - inS) / (inE - inS);
  double resultForNonZeroRange = (outS + (progress * (outE - outS)));
  double result;

  if (inS == inE) {
    if (value <= inS) {
      result = outS;
    } else {
      result = outE;
    }
  } else {
    result = resultForNonZeroRange;
  }
  return result;
}