Polygons

We can draw regular polygons.

Our Simple Square

We can draw a square four sides, equal length, right angles with a repeat that looks quite a lot like that description.

rpt 4 [ fd 5 rt 90 ]

A Triangle

To change the shape, we must change the angle that is turned at the corners (or vertices). It is the outside angle we are turning.

Diagram showing outside angle turned to draw a triangle

For a triangle, this is 120 degrees.

rpt 3 [ fd 5 rt 120 ]

A Square

rpt 4 [ fd 5 rt 90 ]

A Pentagon

rpt 5 [ fd 5 rt 72 ]

More Polygons

What other regular polygons can you draw? How do you work out what angle to turn for each different number of sides?

 

Any Regular Polygon

It turns out there is a pattern. The angle to turn is 360 divided by the number of sides on the shape. That makes sence because we are moving forward and turning all the way round to close the shape.

We can write that in logo like this:

make "sides 6
rpt :sides [ fd 5 rt 360/:sides ]

Change the number after "sides and see what shapes you get. You might need to change the number after fd to get them to fit on the screen.