point method

Offset point(
  1. double t
)

Calculates a point on the cubic curve at a given parameter t.

t A value between 0 (start of the curve) and 1 (end of the curve). Returns the Offset representing the location on the curve at t.

Implementation

Offset point(double t) {
  final rt = 1.0 - t;
  return (start * rt * rt * rt) +
      (cpStart * 3.0 * rt * rt * t) +
      (cpEnd * 3.0 * rt * t * t) +
      (end * t * t * t);
}