The last tutorial demonstrated how to draw a four sided regular polygon, the square.
What we learned about calculating the turtle's turning angle in that tutorial will hold for other regular polygons as well.
For any regular polygon:
The turtle turns a total of 360 degrees as it moves around the
There are as many vertices as sides.
All the vertices have equal turtle turning angles.
The turning angle is calculated by taking 360 degrees and dividing
it by the number of sides (or number of vertices).
Turning angle examples
(turtle's turning angle) = (360 degrees) / (number of sides)
Triangle, 3 sided:
(120 degrees) = (360 degrees) / (3)
Pentagon, 5 sided:
(72 degrees) = (360 degrees) / (5)
And so on....
Running the example program
This is another classic type of EZ Math Movie. It is an animation that will
continuously clear the graph and draw a regular polygon. Before each new
drawing, the program checks with two input gizmos to get values for the number
of sides and the length of a side for a regular polygon. It then draws the
polygon using that information.
Be sure to click on the input gizmos to change the number of sides and the
length of the side.