lerp 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[0];
  double ay = a[1];
  o[0] = ax + f * (b[0] - ax);
  o[1] = ay + f * (b[1] - ay);
  return o;
}