lerp static method

Motion lerp(
  1. Motion a,
  2. Motion b,
  3. double t
)

a to b at t, number by number (settings are b's).

Implementation

static Motion lerp(Motion a, Motion b, double t) {
  var m = b;
  for (final p in properties) {
    final x = a.valueOf(p), y = b.valueOf(p);
    if (x != y) m = m.withValue(p, x + (y - x) * t);
  }
  return m;
}