Q:

Calculating the Coordinates of a Regular Polygon Given Its Center and its side length

I was wondering how to calculate the coordinates of a regular polygon given its center and its side length. I came up with a method for the square already, but I am looking for something that could be applicable to other regular polygons.

A:

Question is poor formulated. But let's assume that the most right edge of regular polygon is vertical. N is number of edges, L is side length. All vertices lie at circle with center given (CX, CY). Radius of this circle:
R = L / (2 * Sin(Pi / N))

I'th vertice of regular N-gon has coordinates:
i = 0..N-1
X[i] = CX + R * Cos(Pi/N * (1 + 2 * i))
Y[i] = CY + R * Sin(Pi/N * (1 + 2 * i))

