lerp method

double lerp(
  1. int end,
  2. double t
)

Linear interpolation between this value and end at t.

Example:

int start = 10;
double result = start.lerp(20, 0.5); // 15.0

Implementation

double lerp(int end, double t) => this + (end - this) * t;