catmullRom static method

num catmullRom(
  1. num p0,
  2. num p1,
  3. num p2,
  4. num p3,
  5. num t,
)

Implementation

static num catmullRom (num p0, num p1, num p2, num p3, num t) {
  double v0 = (p2 - p0) * 0.5;
  double v1 = (p3 - p1) * 0.5;
  num t2 = t * t;
  num t3 = t * t2;
  return (2 * p1 - 2 * p2 + v0 + v1) * t3 + (-3 * p1 + 3 * p2 - 2 * v0 - v1) * t2 + v0 * t + p1;
}