Here's the loop. Basically generates a certain number of points along the circumference of the circle. The points array is obviously constant & can be computed at compile-time, but I can't seem to figure out a way to hoist it into a constexpr.
#include <array>
#include <cmath>
template <std::size_t Len>
class Circle {
public:
Circle() {
for (int i = 0; i < Len; i++) {
float x = (float)std::cos(2 * M_PI * i / (Len - 1));
float y = (float)std::sin(2 * M_PI * i / (Len - 1));
points[i * 3] = x;
points[i * 3 + 1] = y;
points[i * 3 + 2] = 0;
}
}
private:
std::array<float, Len * 3> points;
};