fans function

Iterable<Offset> fans(
  1. Offset outward,
  2. double step,
  3. double maxR
)

Implementation

@pragma('vm:prefer-inline')
Iterable<Offset> fans(Offset outward, double step, double maxR) sync* {
  final dirs = <Offset>[
    outward,
    rot(outward, 0.25 * math.pi),
    rot(outward, -0.25 * math.pi),
    rot(outward, 0.5 * math.pi),
    rot(outward, -0.5 * math.pi),
    -outward,
  ];
  for (double r = step; r <= maxR; r += step) {
    for (final d in dirs) {
      yield d * r;
    }
  }
}