Friday, 10 November 2017

Kete-Pa


Kete-Pa means "good bed". It is the symbol of a good marriage. It is derived from the expression that a woman who has a good marriage is said to sleep on a good bed.

We will use the 5 pixel grid to trace out this image. The image of this is shown below:


This shape is easy to draw. It consists only of straight lines. This lines are horizontal and vertical.

The easiest way to draw this symbol is to use a loop. We will draw the horizontal symbols first and the vertical symbols next.

Thankfully in our template we already have functions that can do this. They are the drawHorizontalLine and drawVerticalLine functions.

The plan to draw this symbol is shown below:
  1. Set the pen size to 10 pixels
  2. Use the drawHorizontalLine function with 11 divisions
  3. Use the drawVerticalLine function with 11 divisions

Using Turtle Graphics

We will use the template.py file and rename it to ketepa.py.

The code for step 1 is given below:

turtle.pensize(10)

The code for step 2 is given below:

drawHorizontalLine(330, 11)

The code for step 3 is given below:

drawVerticalLine(330, 11)

The generated image is shown below:


Conclusion

At the end of this section, we have successfully used Python turtle to draw the Kete-Pa symbol.

This is one of the easiest symbol to draw because it is made up of lines.

Thankfully, we have no need to do any coding because we simply needed to use the functions in our template file.

No comments:

Post a Comment