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