wake function
Position and screen velocity after age seconds in the frame of a projectile
flying right at v px/s, with drag k (1/s) and gravity g.
Implementation
(double, double, double, double) wake(
double x,
double y,
double vx,
double vy,
double age,
double v,
double k, [
double g = 0,
]) {
final e = math.exp(-k * age);
final f = (1 - e) / k;
final vt = g / k;
return (
x + vx * f - v * age,
y + vt * age + (vy - vt) * f,
vx * e - v,
vt + (vy - vt) * e,
);
}