lerp static method

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

Linearly interpolate between two points.

The t argument represents a position on the timeline, with 0.0 meaning interpolation has not started and 1.0 meaning interpolation has finished.

At the start the returned value equals a, and at the end it equals b. As the number advances from 0 to 1 it returns a value closer to a or b respectively.

Implementation

static Point lerp(Point a, Point b, double t) {
  return Point(
    lerpDouble(a.x, b.x, t),
    lerpDouble(a.y, b.y, t),
  );
}