nthBezierCurve function

Float32List nthBezierCurve(
  1. List<num> x,
  2. List<num> y, {
  3. int points = 100,
  4. double portion = 1,
})

Implementation

Float32List nthBezierCurve(List<num> x, List<num> y, {int points = 100, double portion = 1}) {
  final offsets = Float32List((portion * points).floor() * 2 + 2);
  for (int i = 0; i <= points * portion; i++) {
    offsets[2 * i] = nthBezier(x.length - 1, i / points, x);
    offsets[2 * i + 1] = nthBezier(x.length - 1, i / points, y);
  }
  return offsets;
}