Tag Archives: 正五边形

正多边形的点坐标公式

传送门:How to draw a n sided regular polygon in cartesian coordinates?

先上公式,假设要画正N边型,外接圆的中心点坐标为(x_centre, y_centre)
x[n] = r * cos(2*pi*n/N + theta) + x_centre
y[n] = r * sin(2*pi*n/N + theta) + y_centre

这里如果theta取0,那么画出来是歪的。

想正的话,theta = pi[......]

继续阅读