positionLookUpTable method

List<Vector2> positionLookUpTable({
  1. int intervalsCount = 50,
})

Returns a List of Vector2 positions at evenly spaced parameter values from 0.0 to 1.0.

The intervalsCount parameter is used to calculate the size of the interval. The returned List will contain intervalsCount + 1 entries.

Note that although the returned positions will be parametrically equidistant, the arc length between them may vary significantly. To obtain more evenly distributed positions along the arc, use the EvenSpacer class.

Implementation

List<Vector2> positionLookUpTable({int intervalsCount = 50}) {
  final lookUpTable = <Vector2>[];

  for (var index = 0; index <= intervalsCount; index++) {
    final parameterValue = index / intervalsCount;
    final position = pointAt(parameterValue);
    lookUpTable.add(position);
  }

  return lookUpTable;
}