Wednesday 3 January 2018

Mpuannum Nkotimsofo Puua


Mpuannum Nkotimsofo Puua means “Five tufts (of hair)”. It is the symbol of loyalty and priestly office.

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


This shape is simple. It consists of circles. We simply have to get the coordinates from which the drawing of our circles will take place.

The plan to draw the shape is shown below:

  1. Lift the pen
  2. Set the pen size to 20
  3. Draw the center circle
  4. Draw the upper left circle
  5. Draw the upper right circle
  6. Draw the lower left circle
  7. Draw the lower right circle
Using Turtle Graphics


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

The code for steps 1 and 2 are given below:

turtle.penup()
turtle.pensize(20)

The center circle is to be drawn first. Do keep in mind that it is a circle of radius 70 pixels. So we need to first lift up our turtle and move it to the position (0, -70). Then we draw a circle of 70 pixels. The code to do this is shown below:

turtle.setposition(0, -70)
turtle.pendown()
turtle.circle(70)

The generated image is shown below:


To draw the remaining shapes, we need to draw diagonal lines from one part of the grid to the other.

We borrow the code from Akoma Ntoaso project. We only need the diagonal length for the entire grid. This is 565.685424949.

The code below will draw the diagonal line.

turtle.penup()
turtle.setposition(-200, -200)
turtle.setheading(45)
turtle.pendown()
turtle.forward(565.685424949)
turtle.penup()
turtle.setposition(200, -200)
turtle.setheading(135)
turtle.pendown()
turtle.forward(565.685424949)

The generated image is shown below:


To draw the upper left circle, we need to get the coordinates of the point near the circle and place the turtle at that location. For our purposes, the coordinate of the point is (-60, 60). The heading of our turtle will be set to 45 degrees. The code to do this is shown below:

turtle.penup()
turtle.setposition(-60, 60)
turtle.setheading(45)
turtle.pendown()
turtle.circle(70)

The generated image is shown below:


To draw the upper right circle, we need to get the coordinates of the point near the circle and place the turtle at that location. For our purposes, the coordinate of the point is (60, 60). The heading of our turtle will be set to -45 degrees. The code to do this is shown below:

turtle.penup()
turtle.setposition(60, 60)
turtle.setheading(-45)
turtle.pendown()
turtle.circle(70)

The generated image is shown below:


To draw the lower right circle, we need to get the coordinates of the point near the circle and place the turtle at that location. For our purposes, the coordinate of the point is (60, -60). The heading of our turtle will be set to 45 degrees. The code to do this is shown below:

turtle.penup()
turtle.setposition(60, -60)
turtle.setheading(225)
turtle.pendown()
turtle.circle(70)

The generated image is shown below:


To draw the lower left circle, we need to get the coordinates of the point near the circle and place the turtle at that location. For our purposes, the coordinate of the point is (-60, -60). The heading of our turtle will be set to 45 degrees. The code to do this is shown below:

turtle.penup()
turtle.setposition(-60, -60)
turtle.setheading(135)
turtle.pendown()
turtle.circle(70)

The generated image is shown below:


Conclusion

We have successfully drawn the  Mpuannum Nkotimsofo Puua symbol.

No comments:

Post a Comment