Making Polygonal Paths

A polygon is a closed shape that has N-number of vertices and N-number of sides (N ≥ 3). Specifically, something that is called a regular polygon is one in which all sides are of equal length.  We will only be dealing with regular polygons for these tutorials.

Some examples of regular polygon types are below:

  • the equilateral triangle (N = 3)
  • the square (N = 4)
  • the regular pentagon (N = 5)
  • the regular hexagon (N = 6), and etc.

Regular polygons with (N ≥ 36) are of special interest, because in terms of shape they are very close to the circle. Although they are not real circles (real circles lack any vertices), in practice these polygons have so many vertices that are close enough together that they can represent a circle with high precision.

We will try now to do orbits of regular polygons with the ActivityBot.

 

Making Polygonal Paths Using Robots

It is essential to know the external angle of the regular polygon in order to give the robot the appropriate command to turn properly.  An external angle (or exterior angle) is the angle that is formed outside of the polygon between one side and a line extended from another side adjacent to it. It can be difficult to visualize from just reading, so take a look at the image below for visual examples.

The external angle ω , of a regular polygon (N ≥ 3) is given by the formula: ω=360/N.

So, in order to make (clockwise) an equilateral triangle with side S, using the ActivityBot we must give the following commands:

  • Start a new SimpleIDE Project
  • Enter in the code below and make sure load it to your robot with the "Load EEPROM & Run" button

If we want the robot to do a square path of side S (clockwise), we need to give the following commands:

  • Again, start a new SimpleIDE Project
  • Enter in the code below and make sure load it to your robot with the "Load EEPROM & Run" button

If we want the robot to do a regular pentagon path of side S (clockwise) we need to give the following commands:

  • Start another new SimpleIDE Project
  • Enter in the code below and make sure load it to your robot with the "Load EEPROM & Run" button

Based on the exercises above, we can give a general equation for every regular polygon with N vertices (Ν≥3) and side S (clockwise):