code: public static DoubleUnaryOperator interpolate(
          final double minSource, final double maxSource,
          final double minTarget, final double maxTarget)
      {
          final double invDeltaSource = 1.0 / (maxSource - minSource);
          final double deltaTarget = maxTarget - minTarget;
          return new DoubleUnaryOperator()
          {
              @Override
              public double applyAsDouble(double value)
              {
                  double alpha = (value - minSource) * invDeltaSource;
                  return minTarget + alpha * deltaTarget;
              }
          };
      }
docs: Returns a {@link DoubleUnaryOperator} that maps the interval
  [minSource,maxSource] to the interval [minTarget,maxTarget],
  interpolating linearly.<br>
  <br>
  The caller is responsible for passing sensible values.
  Particularly, the <code>minSource</code> and <code>maxSource</code>
  value should have a reasonable difference.
  
  @param minSource The minimum source value
  @param maxSource The maximum source value
  @param minTarget The minimum target value
  @param maxTarget The maximum target value
  @return The {@link DoubleUnaryOperator}