Drawing the diagram

For a given n,k+n,k\in\mathbb{Z}^{+}, k>2k>2, the preceding sections tell us which gnomon nn will be placed in in a kk-polygonal diagram, and in which spot along the gnomon.

To complete the diagram, we need to also determine how much the gnomon is bent at the particular position that nn finds itself at. Because the gnomon is a layer in a regular kk-gon, it bends in increments of the base angle alphakalpha_{k} that is given by Equation (8).

αk=(π((k2)(π/k)))\alpha_{k}=\left(\pi-((k-2)*(\pi/k))\right) (8)

As we draw a gnomon, we’ll start at the left-most position, which for a given nn can be expressed by (x0(n,k),y0(n,k)(x_{0}(n,k),y_{0}(n,k) as defined in (9).

x0(n,k)\displaystyle x_{0}\left(n,k\right) =gnomon(n,k)cos(αk)\displaystyle=-\text{gnomon}\left(n,k\right)\cos{(\alpha_{k})}
y0(n,k)\displaystyle y_{0}\left(n,k\right) =gnomon(n,k)sin(αk)\displaystyle=\text{gnomon}\left(n,k\right)\sin{(\alpha_{k})} (9)

Starting at the initial point (x0(n,k),y0(n,k)(x_{0}(n,k),y_{0}(n,k) for a given nn, we want to move along the gnomon layer up to the gnomon depth of nn (gdepth(n)\text{gdepth}(n)), bending along the gnomon as required. This process is expressed by the sums in the definitions of x(n,k)x(n,k) and y(n,k)y(n,k) of (10).

x(n,k)\displaystyle x(n,k) =x0(n,k)j=1gdepth(n)1cos(αk[ceil(jgsize(n)(k2))+1])\displaystyle=x_{0}(n,k)-\sum_{j=1}^{\text{gdepth}\left(n\right)-1}\cos\left(% \alpha_{k}\cdot\left[\operatorname{ceil}\left(\frac{j}{\text{gsize}\left(n% \right)}\left(k-2\right)\right)+1\right]\right)
y(n,k)\displaystyle y(n,k) =y0(n,k)+j=1gdepth(n)1sin(αk[ceil(jgsize(n)(k2))+1])\displaystyle=y_{0}(n,k)+\sum_{j=1}^{\text{gdepth}\left(n\right)-1}\sin\left(% \alpha_{k}\cdot\left[\operatorname{ceil}\left(\frac{j}{\text{gsize}\left(n% \right)}\left(k-2\right)\right)+1\right]\right) (10)