function lerp(a, b, x) {
  return a + x * (b - a);
}
Calculates the linearly interpolated value of x between a and b.

@param {number} a Number
@param {number} b Number
@param {number} x Value to be interpolated.
@return {number} Interpolated value.