Plot.plot({
width: 450,
aspectRatio: 1,
x: { domain: [-1, 1] },
y: { domain: [-1, 1] },
axis: null,
marks: [
Plot.line(angles, {
x: (i) => Math.sin(n * d * i) * Math.cos(d * i),
y: (i) => Math.sin(n * d * i) * Math.sin(d * i),
stroke: "black",
strokeWidth: 0.33
}),
Plot.line(angles, {
x: (i) => Math.sin(n * i) * Math.cos(i),
y: (i) => Math.sin(n * i) * Math.sin(i),
stroke: "red",
strokeWidth: 2.5
})
]
})