chairsAround function

List<CatalogShape> chairsAround(
  1. double cx,
  2. double cy,
  3. double r,
  4. int count,
)

count chairs around a round top of radius r centred at (cx, cy), at equal angles from the bottom, each tucked chairTuck under the edge.

Implementation

List<CatalogShape> chairsAround(double cx, double cy, double r, int count) {
  final d = r + chairSize / 2 - chairTuck;
  return [
    for (var i = 0; i < count; i++)
      ...chairAt(
          cleanCoordinate(cx + d * math.cos(_around(i, count))),
          cleanCoordinate(cy + d * math.sin(_around(i, count))),
          _around(i, count) + math.pi),
  ];
}