Building in Desmos
To begin building the polygonal number diagrams in Desmos[2], begin with creating sliders for and , and a sequence of the integers between and . The base angle can also be defined.
Slider ; step: 1
Slider ; step: 1
Chose a variable name that does not correspond to one of the already used variables, and implement equations (4) and (5). The value of is defined globally and does not need to be passed as a paramenter. The value of is not used directly; instead, the functions will be evaluated using the values of the array . Here will be used as the parameter name rather than .
Next, implement the gnomon size and depth functions.
Finally, the equations for the coordinates of each plotted point can be defined based on equations (9) and (10).
To plot the points, the functions above are applied to the sequence . The grid and axis can be removed from the plot.
A completed implementation of these instructions can be found here:
https://www.desmos.com/calculator/cz80t85moz.