I want to compute the points of a regular polygon in a loop:
float r = 1.0; for (uint k=0; k < numVerts; k++) { vertlist ~= Vec2D(r * cos(k/n * 2 * PI), ...) } How do I make sure k/n is a float or double?
Enjoys Math via Digitalmars-d-learn Fri, 29 Jan 2016 15:51:07 -0800
I want to compute the points of a regular polygon in a loop:
float r = 1.0; for (uint k=0; k < numVerts; k++) { vertlist ~= Vec2D(r * cos(k/n * 2 * PI), ...) } How do I make sure k/n is a float or double?