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) {
  var progress = (value - inS) / (inE - inS);
  var resultForNonZeroRange = (outS + (progress * (outE - outS)));
  double result;

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