Drawing Polygons

This program draws an equilateral triangle. This is the simplest polygon.
Each side is 40 units.
The Logo turtle turns 120 degrees at each vertex.

repeat 3 [forward 40 right 120]

You must be letter perfect when you type this in!
Press RETURN when you have finished.



Clearing the Screen

To clear the screen type:

clearscreen

or simply:

cs



Changing Colours etc.

Use the "set" menu to change the colour of lines and the screen.



Drawing a Square

You have already drawn a triangle. You can draw a square by using the code:

repeat 4 [forward 100 right 90]

Or use the abbreviations:

repeat 4 [fd 100 rt 90]



Assignment.

  1. Make a copy of this table (you can cut and paste it into Excel).
  2. Use Logo to find the missing angles.
  3. Fill in your table with your answers.
  4. Let your teacher check your table.
ShapeNo of SidesExterior Angle.Sum of External Angles.
Triangle3120360
Square490360
Pentagon     
Hexagon      
Heptgon      
Octagon      
Nonagon      
Decagon      
Elevenagon      
Duodecagon12    


Hints

Does the length of the sides make any difference to the angles of any of the polygons?.
You can make the polygon big and use a fine line to check if the sides actually join up.
Try to spot patterns in the answers and then use this pattern to predict the angles that you need in the formula.


Questions, conclusions and further work.

Write these answers onto the bottom of your Excel spreadsheet.

  1. Write down a rule for finding the exterior angle of a regular polygon.
  2. Write down a rule for the sum of the interior angles of a regular polygon.
  3. Let your teacher check your answers before you send them to the printer.
  4. If time permits, go onto the next Logo exercise and learn how to make a "procedure" to draw any regular polygon.

Interesting Designs.

Groovy Borders

Use the "set" menu to change the colour of lines and the screen. Or use the code below and change the numbers in the setpensize and setpencolor commands.

setpensize [1 1] setpencolor 8 repeat 5 [fd 100 rt 72]

Draw the same polygon, over and over again, with gradually thinner lines in different colours

Swirling Shapes

Make a polygon and then put the polygon code into a repeat loop so that you can draw lots of copies of it gradually turning through 360 degrees.

cs ht repeat 20 [ repeat 5 [fd 100 rt 72] rt 18]



Stellations.

Draw a repeating polygon pattern but then alter the code for the repeat and the polygon.
The first example swaps the 18 and 72 degree angles around. The second one uses 36 degrees instead of 18. If you want your pattern to form a closed loop then the angles used must be related to those of the basic polygon that you have used

cs ht repeat 20 [ repeat 5 [fd 100 rt 18] rt 72]
cs ht repeat 20 [ repeat 5 [fd 100 rt 36] rt 72]