sampleCubic function

List<DiagramPoint> sampleCubic(
  1. DiagramPoint start,
  2. DiagramPoint firstControl,
  3. DiagramPoint secondControl,
  4. DiagramPoint end, {
  5. required int steps,
})

steps + 1 uniformly parameterized points, including both ends.

Implementation

List<DiagramPoint> sampleCubic(
  DiagramPoint start,
  DiagramPoint firstControl,
  DiagramPoint secondControl,
  DiagramPoint end, {
  required int steps,
}) => [
  for (var step = 0; step <= steps; step += 1)
    cubicAt(start, firstControl, secondControl, end, step / steps),
];