lerp static method

double lerp(
  1. double a,
  2. double b,
  3. double x
)

From Closure:

  • Performs linear interpolation between values a and b. Returns the value
  • between a and b proportional to x (when x is between 0 and 1. When x is
  • outside this range, the return value is a linear extrapolation).
  • @param {double} a A number.
  • @param {double} b A number.
  • @param {double} x The proportion between a and b.
  • @return {double} The interpolated value between a and b.

Implementation

static double lerp(double a, double b, double x)
{
  return a + x * (b - a);
}