lerp function

double lerp(
  1. double start,
  2. double stop,
  3. double amount
)

Linear interpolation between start and stop by amount. amount between 0 and 1, inclusive.

Implementation

double lerp(double start, double stop, double amount) {
  assert(amount >= 0.0 && amount <= 1.0);
  return (1.0 - amount) * start + amount * stop;
}