function drawPolygon(context, numberOfSides, radius, rotationDegrees, strokeWidth) {
const centerX = width / 2;
const centerY = height / 2;
const rotationRadians = rotationDegrees * Math.PI / 180;
context.clearRect(0, 0, width, height);
context.beginPath();
for (let i = 0; i <= numberOfSides; i++) {
const angle = 2 * Math.PI / numberOfSides * i + rotationRadians;
const x = centerX + radius * Math.cos(angle);
const y = centerY + radius * Math.sin(angle);
if (i === 0) context.moveTo(x, y);
else context.lineTo(x, y);
}
context.closePath();
context.strokeStyle = "hsl(50deg 100% 50%)";
context.lineWidth = strokeWidth;
context.stroke();
}