Here is my code. I wang polygon’s sided gets more when x gets bigger. But it looks incorrect. Can someone help me check it.

int points;

int radius=100;

void setup() {

size(500, 500);

points=mouseX/20;

}

void draw() {

drawPolygon();

}

void drawPolygon() {

float angleRange = TWO_PI / points;

for (int i = 0; i < points; i++) {

// First angle

float angle = i * angleRange;

// Next angle

float nextAngle = (i + 1) * angleRange;

```
line(width/2+cos(angle) * radius, height/2+ sin(angle) * radius, width/2+ cos(nextAngle) * radius, height/2+ sin(nextAngle) * radius);
```

}

}