# EZ Math Movie, Tutorials, Turtle Graphics, Drawing a Polygon

### Again, the turning angle

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 perimeter.
• 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

In general:

(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.

### The example program

0ptions

Go on input

Bounds:
Sorry, apparently this browser does not support HTML 5 canvas tag graphics.
Printer

Edit: Runtime          View: Starter Suggestion

To runtime:

Storage:

Editor width: Normal Wide

### And....

Next tutorial: A random walk

Here is a link to a related article at EZ Programing Demos:

### Other sites you may find interesting

Like Math and Physics?

Zona Land Education offers explanations, diagrams, and animations on these topics.
And it is all presented in a clear and casual manner.

Want to learn about programing computers?

EZ Programing Demos has an animated, slow motion, interactive programing language demonstrator.
The site presents basic ideas at a beginner's level.

Custom Search

Name:
Domain:

Name
0

Name:
Name
0