As I see it, the purpose of programming is to build machines out of bytes that are impossible or too expensive to build out of atoms. Computers are machines that can imitate any other machine. Programming is the act of making them do that.
Abusua Pa means “Good Family”. It is the symbol of the family unit. Typically in Akan culture, Abusua is the name in Akan culture for a group of people that share common maternal ancestry.
The Abusua line is considered to be passed through the mother’s blood. It is a taboo to marry someone from the same Abusua.
We will use the 5-pixel grid to trace out this image. The image of this is shown below:
Analysing the Symbol
The symbol is a composite symbol made up of a hollowed out square. The inner part of the square consists of four sections which are lined like a window pane.
The outer part of the square intersects with 4 semi-circles. The widths of all the component shapes are the same.
The Plan to Draw the Symbol
To draw this symbol, the first task is to increase the pensize to 40 pixels. Next we move the turtle to the position (-100, 100).
We find the distance between (-100, 100) to (100, -100) and use the drawSquare function to draw the outer square.
Next we move to the position (-100, 0) and draw the horizontal centre line. We then move to the position (0, -100) and draw the vertical centre line.
Once we have completed the outer square and its centre lines, we draw the external semi-circles.
Finally, we reduce the pensize to 5 and draw the inner sections of the symbol.
Algorithm to Draw the Symbol
The algorithm to draw the Abusua Pa symbol is shown below:
Lift up the pen
Set the pensize to 40 pixels
Set the position of the pen to the location (-100, 100)
Place the pen down
Find the length of the side of the outer square
Draw the outer square
Draw the inner centre lines
Draw the outer semi-circles
Reduce the pensize to 5
Draw the inner squares
Using Turtle Graphics
We will use the template.py file and rename it to abusuapa.py.
We then draw a square using the drawSquare function.
The generated image is shown below:
I realize that since we are using the drawSquare function, we no longer need the setposition code. We can comment it out.
To draw the center lines, we have to move the turtle to the left-hand side and move forward by the length of the side. Next, we move the turtle to the bottom, set its heading to 90 degrees and move up by the length of the side. The code to do this is shown below:
To draw the outer circle we will start with the top and move clockwise. To draw the upper circle, we need to move the turtle to the position (50, 120). Then we draw the semi-circle. The code to do this is shown below:
Completing this shape is easy. All we have to do is draw the lines that are within the squares. To do this we must reduce the pensize to 5 and set the orientation of the turtle appropriately to draw the lines.