lerp static method

Vec2D lerp(
  1. Vec2D o,
  2. Vec2D a,
  3. Vec2D b,
  4. double f,
)

Implementation

static Vec2D lerp(Vec2D o, Vec2D a, Vec2D b, double f) {
  double ax = a.x;
  double ay = a.y;
  o.x = ax + f * (b.x - ax);
  o.y = ay + f * (b.y - ay);
  return o;
}