Page 54 - Code & Click - 4
P. 54

DRAWING POLYGONS
              The Pen blocks can be used to draw circles and polygons. Examples of polygons are
              triangles, rectangles, pentagons, hexagons, etc.
              To draw a polygon, the following points should be kept in mind:
                (a)  The number of sides of the polygon must be known.
                (b)  You need to turn the sprite by a specific angle to draw a polygon. The formula to
                      calculate the angle of turn is given by
                                                               360°

                                               number of sides in the polygon
              The table given below gives the value for Repeat block and the angle of turn needed to
              draw various polygons.

               Name of Polygon          Number of Sides          Value for Repeat Block           Angle of Turn

                Triangle                         3                            3                         120
                Square                           4                            4                          90

                Pentagon                         5                            5                          72
                Hexagon                          6                            6                          60

                Octagon                          8                            8                          45
                                                                                                   Experiential Learning
               Lab Activity 4

               Let us draw a hexagon and stamp the Cat sprite at each corner of the
               hexagon.
                  1.  Open a new project.

                  2.  Create the stack of blocks as shown in the given image.
                  3.  Click the Go        button to run the project.
                      The Cat sprite draws a hexagon in orange colour and stamps its
                      image at each corner of the hexagon. Some sample images are
                      given for your reference.
















              DRAWING A CIRCLE
              A circle is a special figure. You can think of a circle as a polygon in which you make a
              turn of 1 degree after every step you move. Thus, to draw a circle, you need to use the
              Repeat block 360 times, and the angle of turn must be 1.

              52
   49   50   51   52   53   54   55   56   57   58   59