Vector2 onApplyLinearForces( Iterable<Force2D> forces, Vector2 velocity, double dt, ) { return forces.fold<Vector2>( velocity, (p, e) => e.transform(p, mass, dt), ); }