position method

  1. @override
Point2D position(
  1. double distance
)
override

Implementation

@override
Point2D position(final double distance) {
  if (distance < 0 || distance > 1) {
    throw ArgumentError.value(
        distance, 'distance', 'Distance must be beteen 0 and 1.');
  }

  return Point2D(
      CatmullRomSpline(_p0.x, _p1.x, _p2.x, _p3.x).position(distance),
      CatmullRomSpline(_p0.y, _p1.y, _p2.y, _p3.y).position(distance));
}