The 17-Gon And Turtle Color Tables

As an example of how to use the color index table of the Turtle controller, let's look at drawing a multicolored regular 17-gon. The construction of the regular 17-gon by ruler and compass was a problem that was tackled by one of the greatest mathematicians of all time Carl Friedrich Gauss. Before Gauss's time, it was known how to construct regular polygons with a prime number of sides when the number of sides was 3 and 5, but no other results were known for polygons with a prime number of sides. At the age of nineteen Gauss discovered a Euclidean construction for the regular seventeen-sided polygon. In fact, Gauss was so proud of this accomplishment that he wished a regular 17-gon to be carved on his tombstone. However, the stonemason who eventually carved the stone refused to carve the figure,  stating that it would be indistinguishable from a circle. Eventually, a monument in Brunswick, Germany, where Gauss grew up, was created with the 17-gon carved into the surface.

Our 17-gon is going to be multi-colored so we need to utilize the capabilities in the "Turtle Colors'' area in the Turtle Controller window.  One can change the drawing color of the turtle at anytime by clicking on one of the colors in the Color Palette.  Additionally, one can change colors grammatically by specifying a table of colors and then indexing through the table by the use of the two symbols ` and '. They function as follows:

To construct a color table we make use of the Color Palette and the "Add Color" button in the "Turtle Colors'' area in the Turtle Controller window.  Let's see how we would do this in the construction of a regular 17-gon.

We will not actually construct the 17-gon using compass and straight-edge techniques as Gauss did, but will "cheat" a bit by caculating the angle needed to construct the 17-gon. This angle is 360/17 degrees or approximately 21.176471. We first define a vector DE and a 21.176471 degree angle ABC as shown below (if you need help with this refer back to the main page on Turtle Geometry).  Create a point F and a turtle at F.

figure 11

Now, we will define a table of colors that the turtle can use to draw segments. We do this by using the Color Palette in the lower left corner of the Turtle Controller window in conjunction with the "Add Color'' button of the Controller window. Click on one of the blue colors in the Color Palette and then on the ``Add Color'' button. The color will appear in the area above the ``Add Color'' button. Now click on a red color and add it to the color table. Fill out the rest of the first row of four colors in the table with orange and green. Then, fill out the rest of the table as you wish. Note that the table has a maximum of 16 colors.

turtle colors

This table will serve as an indexed color table for the ` and ' symbols as described above. To draw a 17-gon we can use a sequence of 17 draw and turn commands as described by the sentence F-F-F-F-F-F-F-F-F-F-F-F-F-F-F-F-F. We will also change color at each step by inserting a ` after each F, yielding F-`F-`F-`F-`F-`F-`F-`F-`F-`F-`F-`F-`F-`F-`F-`F-`F. The turtle will then move
forward one index in the color table each time it reads the ` symbol. Type in F-`F-`F-`F-`F-`F-`F-`F-`F-`F-`F-`F-`F-`F-`F-`F-`F in the axiom box in the Turtle Controller, Type in 0 in the rewrite level box and hit return. Then, hit the Turtle Interpret button to get a multi-colored 17-gon. You may have to move F or shrink DE to keep the polygon in view.

figure 2