stoolsAround function

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

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

Implementation

List<CatalogShape> stoolsAround(double cx, double cy, double r, int count) {
  final d = r + stoolRadius - stoolTuck;
  return [
    for (var i = 0; i < count; i++)
      ...stoolAt(cx + d * math.cos(_around(i, count)),
          cy + d * math.sin(_around(i, count))),
  ];
}