partialBezierPoints function

List<Vector3> partialBezierPoints(
  1. List<Vector3> points,
  2. double a,
  3. double b
)

Implementation

List<Vector3> partialBezierPoints(List<Vector3> points, double a, double b) {
  if (a == 1) {
    return [for (var _ in range(end: points.length)) points.last];
  }

  var aTo1 = [
    for (var i in range(end: points.length)) bezier(points.skip(i).toList())(a)
  ];

  var endProp = (b - a) / (1.0 - a);

  return [
    for (var n in range(end: points.length))
      bezier(aTo1.getRange(0, n + 1).toList())(endProp)
  ];
}