Hi

Suppose I wanted to calculate the vertices of a Pentagon given only its length and that its centre is the origin of the XY axes, how would I do this?

Its for a program i’m trying to write…

I already tried:

void drawPentagon(GLint l)

{

GLfloat hL = l / 2;

GLfloat a = hL / sin(54);

GLfloat b = hL * tan(54);

GLfloat c = a * cos(72);

GLfloat d = a * sin(18);

```
glBegin(GL_POLYGON);
glVertex3f(0.0f, a, 0.0f);
glVertex3f(-d, c, 0.0f);
glVertex3f(-hL, -b, 0.0f);
glVertex3f(hL, -b, 0.0f);
glVertex3f(d, c, 0.0f);
glEnd();
```

}

Which is just messed up.