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:

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
Angle measurement: Degrees Radians

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:

Polygon


All contents of EZ Math Movie are copyrighted: Copyright 2011, Edward A. Zobel. All rights reserved.



Other sites you may find interesting

Zona Land Education 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.

Here is the link: zonalandeducation.com




EZ Programing Demos 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.

Here is the link: ezprogramingdemos.com



Custom Search

Name:
Domain:

Name
0


Name:
Name
0