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; }