I need some assistance with the formula/algorithm to find the vertices of a regular convex polygon (centered at (0,0) and with a circumradius of 1) rotated so that the vertices are as far away from both the x and y axis as possible.
The formula for the vertices of a rotated polygon is ($n$ is the number of sides of the polygon, $i$ is the zero-based vertex number and $\theta$ is the angle of rotation):
Given: $n, i \in \mathbb Z, n \ge 3, 0 \le i \lt n, 0 \le \theta \lt \frac{2\pi}n$
$$ \left(x, y\right)_i = f\left(n, i\right) = \begin{cases} x = \cos\left(i\frac{2\pi}n+\theta\right) \\ y = \sin\left(i\frac{2\pi}n+\theta\right) \\ \end{cases} $$
I need to find a function $\theta = g\left(n\right)$ that will give me the correct rotation for a given polygon. All I have so far is (which doesn't cover all cases):
$$ \theta = g\left(n\right) = \begin{cases} \frac{\pi}n, & \text{if $\left(n \mod 4\right) = 0$} \\ \frac{\pi}{2n}, & \text{if $\left(n \mod 2\right) = 0$} \\ \end{cases} $$
Is there a general formula/algorithm to compute $\theta$?
I'm a programmer working with a neural network and I'm trying to find a way to catagorize my input data. I'm dealing with an n-of-m situtation, i.e. 5 inputs each having one of 26 different values. My first attempt was to have 26 different inputs with the appropriate inputs "on" and the rest "off". That didn't work out very well, so I'm trying something different. This may or may not work, (and if you know the answer to that, please don't spoil it for me) but it's worth a try.