Page 51 - ModularV1.1 _c5_flipbook
P. 51

Heptagon                  Octagon                 Nonagon                   Decagon
                         (7 sides)                (8 sides)                (9 sides)                (10 sides)
                 Drawing Regular Polygons Using Repeat Command


                 It is very easy to draw regular polygons using the REPEAT command. When the
                 sprite draws a polygon, it has to walk along the sides of the polygon, turning at a
                 specified angle at each turn, finally turning 360° before coming back. This walking

                 and turning back of the sprite can be called the total sprite trip.
                 The degree of turn is equal to 360° divided by the number of sides. For example to
                 draw a square, the turtle has to turn 4 times (a square has 4 sides), and each turn is

                 360º/4, that is 90°. To draw a triangle, the degree of turn will be 360°/3 = 120° and
                 to draw a hexagon the degree of turn will be 360°/6 = 60°.
                 To draw polygons, follow these steps:

                                       repeat  10
                 Step 1  Drag the                  block from Control blocks menu.



                 Step 2  Drag  the       move 10  steps   block,    turn   15  degrees   block  and

                           wait  1 secs   block  one by one and  attach inside the Repeat
                          block.

                 Step 3  Change the Repeat value and Turn value accordingly.































                                                                                       Drawing Shapes in Scratch  49
   46   47   48   49   50   51   52   53   54   55   56