function gasketIFS(n) {
let cos = Math.cos;
let sin = Math.sin;
let r =
sin(pi / n) /
(sin(pi / n) + sin(pi / n + (2 * pi * Math.floor(n / 4)) / n));
let ifs = [];
let theta0 = (2 * pi) / n;
for (let i = 0; i < n; i++) {
let theta = theta0 * i;
ifs.push(scale(r, [cos(theta + pi / 2), sin(theta + pi / 2)]));
}
return new IteratedFunctionSystem(ifs);
}