tag:blogger.com,1999:blog-76542573774567959922024-03-13T09:14:10.094-07:00Truston Teaches TechUnknownnoreply@blogger.comBlogger157125tag:blogger.com,1999:blog-7654257377456795992.post-30070453438407001962018-05-08T18:25:00.000-07:002018-05-08T18:25:26.174-07:00This is Not the End<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEienESIjtlD4tA_t2-iFQ725rfxKesTFiDEoLUbxDZ40HvdvJN93lfkoB4hRrakwaM0Xrk8TjLoU_N99Z9tVEJEMMtOln_2WwYCPiMr36LpETdkJJJjL6Fyl33Vx0aP0TztmmH75JdCQtY/s1600/Homecoming.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="280" data-original-width="600" height="185" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEienESIjtlD4tA_t2-iFQ725rfxKesTFiDEoLUbxDZ40HvdvJN93lfkoB4hRrakwaM0Xrk8TjLoU_N99Z9tVEJEMMtOln_2WwYCPiMr36LpETdkJJJjL6Fyl33Vx0aP0TztmmH75JdCQtY/s400/Homecoming.png" width="400" /></a></div>
<div style="text-align: center;">
<br /></div>
If you've seen the <a href="https://en.wikipedia.org/wiki/Black_Panther_(film)" target="_blank">Black Panther</a> movie, the scene where Prince T'Challa returns home shows the <a href="http://www.adinkra.org/htmls/adinkra/wawa.htm" target="_blank">Wawa Aba</a> symbol.<br />
<br />
This is the first time an <a href="https://medium.com/@adinkrahene/adinkra-minimalism-in-african-design-a6bda0067f53" target="_blank">Adinkra</a> symbol is shown in the <a href="https://en.wikipedia.org/wiki/Black_Panther_(film)" target="_blank">movie</a>.<br />
<br />
The <a href="http://www.adinkra.org/htmls/adinkra/wawa.htm" target="_blank">Wawa Aba</a> is the symbol of symbol of hardiness, toughness and perseverance. It literally means "seed of the wawa tree".<br />
<br />
The seed of the wawa tree is extremely hard. In Akan culture, it is a symbol of someone who is strong and tough. It inspires the individual to persevere through hardship<br />
<br />
The symbol is shown below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhUJoR4qRF8K2gWGX6lPp4YN57XkzKRI2zVe-B7jWtYtn3lbZ3KXGU7tJTFGeHzDzHmj4YqD5tP0b5lIGkF602X4pXqby-0wdU99VCkiBJFsVTYB4yUXZX4AZD9DXP7e1wTOnJCUldtvJc/s1600/Wawa-Aba%2540High.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="200" data-original-width="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhUJoR4qRF8K2gWGX6lPp4YN57XkzKRI2zVe-B7jWtYtn3lbZ3KXGU7tJTFGeHzDzHmj4YqD5tP0b5lIGkF602X4pXqby-0wdU99VCkiBJFsVTYB4yUXZX4AZD9DXP7e1wTOnJCUldtvJc/s1600/Wawa-Aba%2540High.png" /></a></div>
<div style="text-align: center;">
<br /></div>
This series was borne out of a desire to fight for the little bits of African culture that remain after the last 500 years of devastation.<br />
<br />
The search is on for what parts of our cultural heritage we can use to build the life of our dreams. Everywhere you look, the African lives without quality and dignity.<br />
<br />
However, we cannot be aided into development. Any sustainable development must come from within. I believe that the key to unlocking our potential lies in remembering the past.<br />
<br />
As at this writing the movie Black Panther has become the <a href="https://en.wikipedia.org/wiki/List_of_highest-grossing_films#Highest-grossing_films" target="_blank">ninth-highest-grossing film of all time</a>.<br />
<br />
Its success points to the fact that there is a hunger for content that elevates African dignity.<br />
<br />
A lot has been lost. To bemoan the past would be to lose sight of the battles we can win right now.<br />
<br />
The battles we can win right now are the battle against our ignorance of self, a lack of unity and a lack of support for the little we have left.<br />
<br />
This is Not the End.<br />
<br />
But for this blog, this <a href="http://trustonteachestech.blogspot.com.ng/p/drawing-adinkra-symbols-using-python.html" target="_blank">series</a> has come to an end. I will be reviewing and rewriting the contents of <a href="http://trustonteachestech.blogspot.com.ng/p/drawing-adinkra-symbols-using-python.html" target="_blank">Drawing Adinkra Symbols using Python</a> on my <a href="http://trustonailende.com/" target="_blank">author platform</a> later in the year.<br />
<br />
I am a recipient of the <a href="http://trustonailende.com/google-africa-challenge-scholarship-program-getting-started/" target="_blank">Google Africa Challenge Scholarship Program</a> so I will be out of action for the next 2 months. I need to focus that time on finishing the course as best as I can.<br />
<br />
So my journey on this blog has come to an end.<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
I shall condense the contents of this <a href="http://trustonteachestech.blogspot.com.ng/p/drawing-adinkra-symbols-using-python.html" target="_blank">series</a> into <a href="http://trustonailende.com/category/series/drawing-adinkra-symbols-using-python/" target="_blank">42 blog posts</a> as soon as I get back from participation in Phase 1 of the <a href="http://trustonailende.com/google-africa-challenge-scholarship-program-getting-started/" target="_blank">Google Africa Challenge Scholarship Program</a>.<br />
<br />
You can sign up for my <a href="http://trustonailende.com/newsletter/" target="_blank">newsletter</a> to stay in touch.<br />
<br />
It's been 46 weeks since I started this <a href="http://trustonteachestech.blogspot.com.ng/p/drawing-adinkra-symbols-using-python.html" target="_blank">series</a>. I am grateful to be able to close the curtain on it.<br />
<br />
See you at my <a href="http://trustonailende.com/" target="_blank">author platform</a>.<br />
<br />
<i>This post is part of the series: <a href="http://trustonteachestech.blogspot.com.ng/p/drawing-adinkra-symbols-using-python.html" target="_blank">Drawing Adinkra Symbols using Python</a>. The goal is to draw 40 Adinkra symbols using the Python programming language.</i>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7654257377456795992.post-27165281300471108352018-05-06T20:29:00.000-07:002018-05-06T20:29:55.219-07:00UAC Nkanea<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhU5H2NaZQHzJV92PrtRb069YO-5nNuF6Yo95pMK9KKQypPxQB5ZUL_WCRQy4S01WS65vOJsNfyZuxmwWU0h7A9RZueknGG3A4nn2CJp_TfHGxdQQfZ9qt7zR8DlZ9DNdznUABv3OLWL-E/s1600/UAC+Nkanea.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="200" data-original-width="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhU5H2NaZQHzJV92PrtRb069YO-5nNuF6Yo95pMK9KKQypPxQB5ZUL_WCRQy4S01WS65vOJsNfyZuxmwWU0h7A9RZueknGG3A4nn2CJp_TfHGxdQQfZ9qt7zR8DlZ9DNdznUABv3OLWL-E/s1600/UAC+Nkanea.png" /></a></div>
<div style="text-align: center;">
<br /></div>
UAC Nkanea means "UAC lights". It is the symbol of technological advancement.<br />
<br />
Several of the symbols in the adinkra cloths record social changes that have been brought about by both external and internal factors.<br />
<br />
For example, the Aban (Castle, Fortress), Kuronti ne Akwamu (Council of State), Ohene Tuo (King’s Gun), UAC Nkanea (UAC Lights), Benz, Television, Kookoo Dua (Cocoa Tree), and Sedee or Serewa (Cowrie Shell) symbols record specific technological developments and historical events that led to particular changes and factors that influenced the direction of such changes in the Asante (Akan) and Ghanaian society.<br />
<br />
We will use the 5 pixel grid to trace out this image. The image of this is shown below:<br />
<div style="text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0YskxMhPVFKOqvesfG6mOnTc41M-yHYknyqi7IiBHudHr22nM6WaaSYAUT1dgSRtuRiwJaIzg4I1Dcc2HfwppDLfVgTpvS28QWQg-LPBdut1Pwpw7XvI402AJrRt4l6fIAPP6REvi8UI/s1600/Grid.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="200" data-original-width="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0YskxMhPVFKOqvesfG6mOnTc41M-yHYknyqi7IiBHudHr22nM6WaaSYAUT1dgSRtuRiwJaIzg4I1Dcc2HfwppDLfVgTpvS28QWQg-LPBdut1Pwpw7XvI402AJrRt4l6fIAPP6REvi8UI/s1600/Grid.png" /></a></div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: left;">
The plan to draw this shape is given below:</div>
<div style="text-align: left;">
</div>
<ol>
<li>Set the pensize to 40 pixels</li>
<li>Lift the pen up</li>
<li>Starting with the part of the symbol in the upper left quadrant, change the heading to the heading for the starting point in that quadrant</li>
<li>Move it to the starting point for the quadrant</li>
<li>Place the pen down</li>
<li>Move forward by 90 pixels</li>
<li>Turn right by 90 degrees</li>
<li>Move forward by 170 pixels</li>
<li>Turn right by 90 degrees</li>
<li>Move foward by 120 pixels</li>
<li>Move backward by 30 pixels</li>
<li>Turn left by 90 degrees</li>
<li>Move forward by 90 pixels</li>
<li>Repeat steps 2 to 12 changing the heading for the quadrant</li>
</ol>
<div>
<div>
<u>Using Turtle Graphics</u></div>
<div>
<br /></div>
<div>
We will use the template.py file and rename it to uac.py.</div>
<div>
<br /></div>
<div>
The code for step 1 is shown below:</div>
<div>
<br /></div>
<div>
turtle.pensize(40)</div>
<div>
<br /></div>
<div>
Steps 2 to 13 repeat so we will use a function that draws the portion of the shape in a quadrant.</div>
<div>
<br /></div>
<div>
The code for the function is shown below:</div>
<div>
<br /></div>
<div>
def drawInQuadrant(x, y, heading):</div>
<div>
turtle.penup()</div>
<div>
turtle.setposition(x, y)</div>
<div>
turtle.setheading(heading)</div>
<div>
turtle.pendown()</div>
<div>
turtle.forward(90)</div>
<div>
turtle.right(90)</div>
<div>
turtle.forward(170)</div>
<div>
turtle.right(90)</div>
<div>
turtle.forward(120)</div>
<div>
turtle.backward(30)</div>
<div>
turtle.left(90)</div>
<div>
turtle.forward(90)</div>
<div>
<span style="white-space: pre;"> </span></div>
<div>
The code to call the function is shown below:</div>
<div>
<br /></div>
<div>
drawInQuadrant(-170, 80, 90)</div>
<div>
<br /></div>
<div>
The generated image is shown below:</div>
</div>
<div>
<br /></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjs7g6_B3c6voXFElAcjBf84kN20-2ZPdjXQA_yDfC6L6p6oblML3G3D5A8a3Q3FEKQAZ5VNgLuosr3nUD2UMhB6YOSYrrE6Bxtw-gHEKUagMPd3we-IDEG5XMA7sr3Qw50eeHl0LfZSpI/s1600/Upper+Quadrant.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="403" data-original-width="403" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjs7g6_B3c6voXFElAcjBf84kN20-2ZPdjXQA_yDfC6L6p6oblML3G3D5A8a3Q3FEKQAZ5VNgLuosr3nUD2UMhB6YOSYrrE6Bxtw-gHEKUagMPd3we-IDEG5XMA7sr3Qw50eeHl0LfZSpI/s320/Upper+Quadrant.png" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
To draw the remaining parts of the symbol, we need the coordinates of the remaining points and their respective headings.<br />
<br />
Moving in a clockwise fashion, they are:<br />
<div>
<ol>
<li>(80, 170) with heading 0</li>
<li>(170, -80) with heading 270</li>
<li>(-80, -170) with heading 180</li>
</ol>
<div>
<div>
The code to call the functions is shown below:</div>
<div>
<br /></div>
<div>
drawInQuadrant(80, 170, 0)</div>
<div>
drawInQuadrant(170, -80, 270)</div>
<div>
drawInQuadrant(-80, -170, 180)</div>
<div>
<br /></div>
<div>
The generated image is shown below:</div>
</div>
</div>
<div style="text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg90CVL3Noq-vugxiZA-5p9jOuhN90jrEQT3IgT2jZlLNn9TcQaWlLWLPusDTPxvQbkvBcDMgnBQiBADGENhUmpbiypHV92ifeAbRKjREhzBakEGDErRaDuFrcdYt08GKsMpyOh54BS5aQ/s1600/Final+Symbol.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="404" data-original-width="404" height="319" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg90CVL3Noq-vugxiZA-5p9jOuhN90jrEQT3IgT2jZlLNn9TcQaWlLWLPusDTPxvQbkvBcDMgnBQiBADGENhUmpbiypHV92ifeAbRKjREhzBakEGDErRaDuFrcdYt08GKsMpyOh54BS5aQ/s320/Final+Symbol.png" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
<u>Conclusion</u><br />
<br />
At the end of this section, we have successfully drawn the UAC Nkanea symbol.<br />
<br />
This post is part of the series: <a href="http://trustonteachestech.blogspot.com.ng/p/drawing-adinkra-symbols-using-python.html" target="_blank">Drawing Adinkra Symbols using Python</a>. The goal is to draw 40 Adinkra symbols using the Python programming language.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7654257377456795992.post-34402077382543499932018-05-06T19:34:00.000-07:002018-05-06T19:38:44.269-07:00Som Onyankopon<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7A3x_rI_9fnukuLBLHykFZq-xD_njubbmlUlxWqdOeOYLPBavOj4ZiAzujD8SvuCOgK9dAIJPQ5AEmzdeTsthMx8PdeKeCfqkexVZ22GifplziOnXvhSkiPsX9vQTzSL9vDEkYRhi7-U/s1600/Som+Onyankopon.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="200" data-original-width="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7A3x_rI_9fnukuLBLHykFZq-xD_njubbmlUlxWqdOeOYLPBavOj4ZiAzujD8SvuCOgK9dAIJPQ5AEmzdeTsthMx8PdeKeCfqkexVZ22GifplziOnXvhSkiPsX9vQTzSL9vDEkYRhi7-U/s1600/Som+Onyankopon.png" /></a></div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: center;">
<div style="text-align: left;">
Som Onyankopon means "Worship God". It is the symbol of devotion to God.</div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
We will use the 5 pixel grid to trace out this image. The image of this is shown below:</div>
</div>
<div style="text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjujpF1prMdDTexwtqPAIEYstCnT-4uiGeIzF428UFWdcCiAbtajwfGEDCL1oB_Mc68_t06YmO-yFVtOGrImhVtPsLs43CSQwN7vxMKTJAIXk-ar7maLfjeplEuHTTDgbkA09bYX2w0mOA/s1600/Grid.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="200" data-original-width="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjujpF1prMdDTexwtqPAIEYstCnT-4uiGeIzF428UFWdcCiAbtajwfGEDCL1oB_Mc68_t06YmO-yFVtOGrImhVtPsLs43CSQwN7vxMKTJAIXk-ar7maLfjeplEuHTTDgbkA09bYX2w0mOA/s1600/Grid.png" /></a></div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: center;">
<div style="text-align: left;">
The plan to draw this shape is given below:</div>
<div style="text-align: left;">
</div>
<ol>
<li style="text-align: left;">Lift up the pen</li>
<li style="text-align: left;">Set the pensize to 40 pixels</li>
<li style="text-align: left;">Draw the vertical line at the centre</li>
<li style="text-align: left;">Draw all the U shaped figures</li>
<li style="text-align: left;">Draw the horizontal line</li>
</ol>
<br />
<div style="text-align: left;">
<u>Using Turtle Graphics</u></div>
<div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
We will use the template.py file and rename it to som.py.</div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
The code for steps 1 and 2 are shown below:</div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
turtle.penup()</div>
<div style="text-align: left;">
turtle.pensize(40)</div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
To draw the vertical line, we move the turtle to the position (0, 160) and move forward by 140 pixels.</div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
The code to do this is shown below:</div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
turtle.setposition(0, 160)</div>
<div style="text-align: left;">
turtle.pendown()</div>
<div style="text-align: left;">
turtle.setheading(270)</div>
<div style="text-align: left;">
turtle.forward(220)</div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
The generated image is shown below:</div>
</div>
<div style="text-align: left;">
<br /></div>
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3llGS4kzTBDn4NHaUZzQ56iBSq-5TK8Yy0SN830HYcdJbDQ9IEDdLg9vqY3VUDFrrtYpttVXJxv14i7_AAC3Ceo_MTpcr8c1IrR0X_fg5Ruxs1SSc47T28uNghiciC9reXPvJB1sM-kM/s1600/Vertical+Line.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="403" data-original-width="403" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3llGS4kzTBDn4NHaUZzQ56iBSq-5TK8Yy0SN830HYcdJbDQ9IEDdLg9vqY3VUDFrrtYpttVXJxv14i7_AAC3Ceo_MTpcr8c1IrR0X_fg5Ruxs1SSc47T28uNghiciC9reXPvJB1sM-kM/s320/Vertical+Line.png" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: center;">
<div style="text-align: left;">
Working from the bottom, we shall draw the U shaped symbols and then the final horizontal line.</div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
To draw the first U shape, we move the turtle to the position (-40, -80), move 80 pixels, turn to the left by 90 degrees and move another 80 pixels.</div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
The code to do this is shown below:</div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
turtle.penup()</div>
<div style="text-align: left;">
turtle.setposition(-40, -80)</div>
<div style="text-align: left;">
turtle.pendown()</div>
<div style="text-align: left;">
turtle.setheading(270)</div>
<div style="text-align: left;">
turtle.forward(80)</div>
<div style="text-align: left;">
turtle.left(90)</div>
<div style="text-align: left;">
turtle.forward(80)</div>
<div style="text-align: left;">
turtle.left(90)</div>
<div style="text-align: left;">
turtle.forward(80)</div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
The generated image is shown below:</div>
</div>
<div style="text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOi5Ey0TwCJdI9NXgi368Lq0nXyVPDQazRlnbPYHw-fEc383vaLZUAsZiuSht-ocrInuc2TE9oG1j8_Sclw4oCNZpDW5YkOwOBYk-1T49pP33dug4pb5-1HqXKLicYxY384xMYwFLolJY/s1600/Lowest+U+Shape.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="403" data-original-width="403" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOi5Ey0TwCJdI9NXgi368Lq0nXyVPDQazRlnbPYHw-fEc383vaLZUAsZiuSht-ocrInuc2TE9oG1j8_Sclw4oCNZpDW5YkOwOBYk-1T49pP33dug4pb5-1HqXKLicYxY384xMYwFLolJY/s320/Lowest+U+Shape.png" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: center;">
<div style="text-align: left;">
To draw the lower U shaped symbol, we need to move the turtle to the position (-130, 0) and repeat the steps above only that instead of 80 pixels when we turn, we move by 260 pixels.</div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
The code to do this is shown below:</div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
turtle.penup()</div>
<div style="text-align: left;">
turtle.setposition(-130, 0)</div>
<div style="text-align: left;">
turtle.pendown()</div>
<div style="text-align: left;">
turtle.setheading(270)</div>
<div style="text-align: left;">
turtle.forward(80)</div>
<div style="text-align: left;">
turtle.left(90)</div>
<div style="text-align: left;">
turtle.forward(260)</div>
<div style="text-align: left;">
turtle.left(90)</div>
<div style="text-align: left;">
turtle.forward(80)</div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
The generated image is shown below:</div>
</div>
<div style="text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhLC0U6468EQi_OpnSIql6i7nYT8YfXvHORvRU3sNcIEbS70TtCUGse-9xvG9pjwAQQbtMiAAe3ZH-1w7uJY1MXz2hteUR-FIjnJv5RC7j4_SpH-H2zlh6vgGXJ2dej02yVBUkB4yXw4XA/s1600/Lower+U+Shape.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="403" data-original-width="403" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhLC0U6468EQi_OpnSIql6i7nYT8YfXvHORvRU3sNcIEbS70TtCUGse-9xvG9pjwAQQbtMiAAe3ZH-1w7uJY1MXz2hteUR-FIjnJv5RC7j4_SpH-H2zlh6vgGXJ2dej02yVBUkB4yXw4XA/s320/Lower+U+Shape.png" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: center;">
<div style="text-align: left;">
To draw the low U shaped symbol, we need to move the turtle to the position (-80, 80) and repeat the steps above only that instead of 80 pixels when we turn, we move by 160 pixels.</div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
The code to do this is shown below:</div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
turtle.penup()</div>
<div style="text-align: left;">
turtle.setposition(-80, 80)</div>
<div style="text-align: left;">
turtle.pendown()</div>
<div style="text-align: left;">
turtle.setheading(270)</div>
<div style="text-align: left;">
turtle.forward(80)</div>
<div style="text-align: left;">
turtle.left(90)</div>
<div style="text-align: left;">
turtle.forward(160)</div>
<div style="text-align: left;">
turtle.left(90)</div>
<div style="text-align: left;">
turtle.forward(80)</div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
The generated image is shown below:</div>
</div>
<div style="text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgUy1jIpIP38lCreTRgQFEL2m2m4c9MpR0cybMN4otJ2pxN7G-I-uq8Vfn2EJg18YKneGv9XylO_u7z_-rWD0Xo7Xk_M4uKxPPMV55-r3fX1Tf7jyBUXTCJn3Hw3cZkDs2TNwcyV-QcDA/s1600/Low+U+Shape.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="403" data-original-width="403" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgUy1jIpIP38lCreTRgQFEL2m2m4c9MpR0cybMN4otJ2pxN7G-I-uq8Vfn2EJg18YKneGv9XylO_u7z_-rWD0Xo7Xk_M4uKxPPMV55-r3fX1Tf7jyBUXTCJn3Hw3cZkDs2TNwcyV-QcDA/s320/Low+U+Shape.png" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: center;">
<div style="text-align: left;">
To draw the horizontal line, we move the turtle to the position (-40, 120). Place the pen down, set the orientation of the turtle to 0 degrees and move forward by 80 pixels.</div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
The code to do this is shown below:</div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
turtle.penup()</div>
<div style="text-align: left;">
turtle.setposition(-40, 120)</div>
<div style="text-align: left;">
turtle.pendown()</div>
<div style="text-align: left;">
turtle.setheading(0)</div>
<div style="text-align: left;">
turtle.forward(80)</div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
The generated image is shown below</div>
</div>
<div style="text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7HHdf2O7tNDBvxy2zEs3jxc99tRAGsEb2VVDhwpaxCv0BrG_9gC8_kwCz-CNosZgjV5x0EQL3BTFvPyrL-YMXW4fHra33QrXZRL1TEM4YMBqJwubv_ATJ9fVlsm5TbM7coP81E-_9wnk/s1600/Final+Symbol.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="403" data-original-width="403" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7HHdf2O7tNDBvxy2zEs3jxc99tRAGsEb2VVDhwpaxCv0BrG_9gC8_kwCz-CNosZgjV5x0EQL3BTFvPyrL-YMXW4fHra33QrXZRL1TEM4YMBqJwubv_ATJ9fVlsm5TbM7coP81E-_9wnk/s320/Final+Symbol.png" width="320" /></a></div>
<div style="text-align: center;">
<u><br /></u></div>
<div style="text-align: left;">
<u>Conclusion</u><br />
<br />
<div class="MsoNormal" style="line-height: 114%; margin-bottom: 10.0000pt;">
<span style="font-size: 12pt; line-height: 114%;">At the end of this section, we have successfully drawn the Som Onyankopon symbol.</span><span style="font-size: 12pt; line-height: 114%;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 114%; margin-bottom: 10.0000pt;">
<span style="font-size: 12pt; line-height: 114%;">It looks like a catcus tree to me but also like a cathedral.</span><span style="font-size: 12pt; line-height: 114%;"><o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-size: 12pt;">This post is part of the series: <a href="http://trustonteachestech.blogspot.com.ng/p/drawing-adinkra-symbols-using-python.html" target="_blank">Drawing Adinkra Symbols using Python</a>. The goal is to draw 40 Adinkra symbols using the Python programming language.</span></div>
</div>
<br />Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7654257377456795992.post-34367028107763670312018-05-06T09:40:00.000-07:002018-05-06T09:40:57.291-07:00Sepow<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiH0rowbrFJOhzXrcZdP4Cq-4rgQqyMC5nqgwT5-CA1-GLV56huqlKqEdHAYWZlRz88h_20MRatlcTZevTGB1tv9dviKA4RNYUWeLcZp9fVHIbM90i0VWUs7drpj3cIcSKgagqSVPGIX0w/s1600/Sepow.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="200" data-original-width="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiH0rowbrFJOhzXrcZdP4Cq-4rgQqyMC5nqgwT5-CA1-GLV56huqlKqEdHAYWZlRz88h_20MRatlcTZevTGB1tv9dviKA4RNYUWeLcZp9fVHIbM90i0VWUs7drpj3cIcSKgagqSVPGIX0w/s1600/Sepow.png" /></a></div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: left;">
<div>
Sepow means "Executioner's knife". It is the symbol of A symbol of justice.</div>
<div>
<br /></div>
<div>
We will use the 5 pixel grid to trace out this image. The image of this is shown below:</div>
<div>
<br /></div>
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDsMVo2EXXx3HUmFlbMDA0re0SsCsJnjE6ymcOlUKzjk1uEQSGVZwQlKvk3J3DXYlaWwroSOV-zfJbzyp9L_DDXk0q4mSw8KHQn1AWx79zwC81-mkP2Rg1_6T9HxevtPbOuwBWHhih61A/s1600/Grid.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="200" data-original-width="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDsMVo2EXXx3HUmFlbMDA0re0SsCsJnjE6ymcOlUKzjk1uEQSGVZwQlKvk3J3DXYlaWwroSOV-zfJbzyp9L_DDXk0q4mSw8KHQn1AWx79zwC81-mkP2Rg1_6T9HxevtPbOuwBWHhih61A/s1600/Grid.png" /></a></div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: left;">
The plan to draw this shape is given below:</div>
<div style="text-align: left;">
<ol>
<li>Lift up the pen</li>
<li>Set the pensize to 30 pixels</li>
<li>Move the pen to the location of the leftmost part of the triangle</li>
<li>Find the distance and the angle between the leftmost part and the topmost part</li>
<li>Draw the triangle</li>
<li>Draw the circle</li>
</ol>
<div>
<div>
<u>Using Turtle Graphics</u></div>
<div>
<br /></div>
<div>
We will use the template.py file and rename it to sepow.py.</div>
<div>
<br /></div>
<div>
Steps 1 and 2 are simple, we only need to lift up the pen. The code to do this is shown below:</div>
<div>
<br /></div>
<div>
turtle.penup()</div>
<div>
turtle.pensize(30)</div>
<div>
<br /></div>
<div>
The leftmost tip of the pen is at (-105, -20) to find the optimal position of the pen, we must add 15 pixels to it. This gives us: (-90, -5).</div>
<div>
<br /></div>
<div>
Compensating for the position of the pen, the coordinate of the topmost position is (0, 175).</div>
<div>
<br /></div>
<div>
The function to find the angle between the two points is given below:</div>
<div>
<br /></div>
<div>
def angleBetweenPoints(x1, y1, x2, y2):</div>
<div>
myradians = math.atan2(y2 - y1, x2 - x1)</div>
<div>
angle = math.degrees(myradians)</div>
<div>
return angle</div>
<div>
<span style="white-space: pre;"> </span></div>
<div>
The function to find the distance between the two point is given below:</div>
<div>
<br /></div>
<div>
def coordinateDistance(x1, y1, x2, y2):</div>
<div>
dx = x1 - x2</div>
<div>
dy = y1 - y2</div>
<div>
D = math.sqrt((dx * dx) + (dy * dy))</div>
<div>
return D</div>
<div>
<span style="white-space: pre;"> </span></div>
<div>
To use the above functions, we use the code shown below:</div>
<div>
<br /></div>
<div>
angle = angleBetweenPoints(-90, -5, 0, 175)</div>
<div>
length = coordinateDistance(-90, -5, 0, 175)</div>
<div>
<br /></div>
<div>
To draw the triangle, we use the code shown below:</div>
<div>
<br /></div>
<div>
turtle.setposition(-90, -5)</div>
<div>
turtle.pendown()</div>
<div>
turtle.setheading(angle)</div>
<div>
turtle.forward(length)</div>
<div>
turtle.setheading(360 - angle)</div>
<div>
turtle.forward(length)</div>
<div>
turtle.setheading(180)</div>
<div>
length = coordinateDistance(-90, -5, 90, -5)</div>
<div>
turtle.forward(length)</div>
<div>
<br /></div>
<div>
The generated image is shown below:</div>
</div>
<div>
<br /></div>
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtN1SLw8IfsYXzDByQ0s-FYrrtDOCqDANNlacFdLZLUTW2bPkBsc27cV-WFnsD2rAmhhjdSlTXOtZha5pa07yA-Wx9aheLQs64CwEVZtHvd8pwOfR3H32EZarRmJ0DZA9SKMAzqux2e04/s1600/Knife+Head.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="403" data-original-width="403" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtN1SLw8IfsYXzDByQ0s-FYrrtDOCqDANNlacFdLZLUTW2bPkBsc27cV-WFnsD2rAmhhjdSlTXOtZha5pa07yA-Wx9aheLQs64CwEVZtHvd8pwOfR3H32EZarRmJ0DZA9SKMAzqux2e04/s320/Knife+Head.png" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
<div>
<div>
Drawing the circle is quite easy. We move the turtle to the position (85, -90) and draw a circle of radius 85 pixels.</div>
<div>
<br /></div>
<div>
The code to do this is shown below:</div>
<div>
<br /></div>
<div>
turtle.penup()</div>
<div>
turtle.setposition(85, -90)</div>
<div>
turtle.pendown()</div>
<div>
turtle.setheading(90)</div>
<div>
turtle.circle(85)</div>
<div>
<br /></div>
<div>
The generated image is shown below:</div>
</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhuBrlEwxqJYiZ6J73Y8dCPCx5f7jGC76t9WRVM8E2j_l1Ukm9j6IkP8UFrZDK3Cn4VVHykau_hTXy5uaHo1BfVWKCVvIZSxd2KzqH5GqNPO6xG5kFDKbgPeo_KjCcoS9PXjfjD-iYk9wY/s1600/Final+Symbol.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="403" data-original-width="403" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhuBrlEwxqJYiZ6J73Y8dCPCx5f7jGC76t9WRVM8E2j_l1Ukm9j6IkP8UFrZDK3Cn4VVHykau_hTXy5uaHo1BfVWKCVvIZSxd2KzqH5GqNPO6xG5kFDKbgPeo_KjCcoS9PXjfjD-iYk9wY/s320/Final+Symbol.png" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: left;">
<u>Conclusion</u></div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<div>
At the end of this section, we have successfully drawn the Sepow symbol.</div>
<div>
<br /></div>
<div>
This post is part of the series: <a href="http://trustonteachestech.blogspot.com.ng/p/drawing-adinkra-symbols-using-python.html" target="_blank">Drawing Adinkra Symbols using Python</a>. The goal is to draw 40 Adinkra symbols using the Python programming language.</div>
</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7654257377456795992.post-18876180395082685682018-05-04T14:35:00.001-07:002018-05-04T14:35:16.031-07:00Kyemfere<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhM1C17ztbMresktqo-jNOQ5XwPUpTB9jrHnnFbpNVPOKGqty4g23BG9ALWZS3GDCt0SRnveqav2MDsF4f8V3e8zdJ_rUYWZuUjOkU7ZU5btWo2QxMznhuvV34Mtl3ggPjqwZzpW168Up8/s1600/Kyemfere.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="200" data-original-width="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhM1C17ztbMresktqo-jNOQ5XwPUpTB9jrHnnFbpNVPOKGqty4g23BG9ALWZS3GDCt0SRnveqav2MDsF4f8V3e8zdJ_rUYWZuUjOkU7ZU5btWo2QxMznhuvV34Mtl3ggPjqwZzpW168Up8/s1600/Kyemfere.png" /></a></div>
<div style="text-align: center;">
<br /></div>
Kyemfere means "Potsherd". It is the symbol of experience, knowledge, service, antiquity, time, heirloom and rarity.<br />
<br />
We will use the 5 pixel grid to trace out this image. The image of this is shown below:<br />
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhdWJLt5r4tycaIZt7iA-KuHEtME6rFnfUlZndXONJO8C2iD0qCFipAOmcaBQlMJX26P8EmgqA5nYmZ5Iq7YwaitP02hwmOdZArYoWkYuzsrmFgoXnqPlIau2YhPLikHsG6LzWEBLep14A/s1600/Grid.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="200" data-original-width="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhdWJLt5r4tycaIZt7iA-KuHEtME6rFnfUlZndXONJO8C2iD0qCFipAOmcaBQlMJX26P8EmgqA5nYmZ5Iq7YwaitP02hwmOdZArYoWkYuzsrmFgoXnqPlIau2YhPLikHsG6LzWEBLep14A/s1600/Grid.png" /></a></div>
<div style="text-align: center;">
<br /></div>
<div>
<div>
The plan to draw this shape is given below:</div>
<div>
<ol>
<li>Divide the symbol into 4 equal parts</li>
<li>Get the coordinates of the centers of the 4 quadrants</li>
<li>Lift up the pen</li>
<li>Place the pen in center of the upper left quadrant</li>
<li>Move to the top left corner of the upper left quadrant</li>
<li>Place the pen down</li>
<li>Set the heading of the pen to 315 degrees</li>
<li>Draw a line from the top left corner to the bottom right corner</li>
<li>Set the heading of the pen to 180 degrees</li>
<li>Move forward to the length of the middle of the center of the quadrant</li>
<li>Set the heading of the pen to 90 degrees</li>
<li>Move forward to the end of the length of the symbol</li>
<li>Set the heading for the pen to 180 degrees</li>
<li>Move forward by half of the length of the symbol</li>
<li>Fill the shape</li>
<li>Lift up the pen</li>
<li>Place the pen in the right upper quadrant</li>
<li>Place the pen down</li>
<li>Set the heading of the pen of the pen to 225 degrees</li>
<li>Draw a line from the upper right quadrant to the lower left quadrant</li>
<li>Set the heading of the pen to 90 degrees</li>
<li>Move forward by half of the length of the side of the quadrant</li>
<li>Set the heading of the pen to 0 degrees</li>
<li>Move forward by the length of the quadrant</li>
<li>Set the heading of the pen to 90 degrees</li>
<li>Move forward by half of the length of the quadrant</li>
<li>Fill the shape</li>
<li>Repeat steps 3 - 27 for the remaining quadrants</li>
</ol>
<div>
<div>
<u>Using Turtle Graphics</u></div>
<div>
<br /></div>
<div>
We will use the template.py file and rename it to kyemfere.py.</div>
<div>
<br /></div>
<div>
The first step of our plan is manual. We have to find the center of the symbols in all the quadrants.</div>
<div>
<br /></div>
<div>
The image is divided into 4 parts as shown below:</div>
</div>
</div>
</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWamJbPGwXX0M1I6mAy82oMDk47hpInEZ-hgVUC1h_fKqYiOgzi5yLQ4787uRnmYa7w8rXAdcJSSJm9EM3Nq31QoNnigb6NiOqt0L0K355flBbkQXmF8LJ5afYi7e1JZI8zOHEKcUIbPg/s1600/Quadrant.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="200" data-original-width="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWamJbPGwXX0M1I6mAy82oMDk47hpInEZ-hgVUC1h_fKqYiOgzi5yLQ4787uRnmYa7w8rXAdcJSSJm9EM3Nq31QoNnigb6NiOqt0L0K355flBbkQXmF8LJ5afYi7e1JZI8zOHEKcUIbPg/s1600/Quadrant.png" /></a></div>
<div style="text-align: center;">
<br /></div>
<div>
<div>
The coordinates of the centers of the quadrants starting from the upper right quadrant and moving clockwise are: (-95, 95), (95, 95), (95, -95) and (-95, -95).</div>
<div>
<br /></div>
<div>
Now we lift up the pen and move it to the position of the center of the first quadrant. The code to do this is shown below:</div>
<div>
<br /></div>
<div>
turtle.penup()</div>
<div>
turtle.setposition(-95, 95)</div>
<div>
<br /></div>
<div>
The top left corner of the quadrant is at (-190, 190) we move the pen to that position and set the heading of the pen to 45 degrees. We then find the length from the top left corner to the center of the entire symbol. The code to do this is shown below:</div>
<div>
<br /></div>
<div>
turtle.setposition(-190, 190)</div>
<div>
turtle.pendown()</div>
<div>
<br /></div>
<div>
Before we can draw a line from the upper left quadrant to the center of the symbol, we need to use the coordinateDistance function to find the distance between the two points. The code for the function is shown below:</div>
<div>
<br /></div>
<div>
def coordinateDistance(x1, y1, x2, y2):</div>
<div>
dx = x1 - x2</div>
<div>
dy = y1 - y2</div>
<div>
D = math.sqrt((dx * dx) + (dy * dy))</div>
<div>
return D</div>
<div>
<span style="white-space: pre;"> </span></div>
<div>
length = coordinateDistance(-190, 190, 0, 0)</div>
<div>
<br /></div>
<div>
To place the pen down you use the code shown below:</div>
<div>
<br /></div>
<div>
turtle.pendown()</div>
<div>
<br /></div>
<div>
We set the heading of the pen and we move from the top left corner of the quadrant to the center of the symbol. The code to do this is shown below:</div>
<div>
<br /></div>
<div>
turtle.setheading(315)</div>
<div>
turtle.forward(length)</div>
<div>
<br /></div>
<div>
Now that the shape is done, we need to fill it. To fill the shape, we place the turtle.begin_fill() and turtle.end_fill() functions before and at the end of the drawing code.</div>
<div>
<br /></div>
<div>
The generated image is shown below:</div>
</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhASez195HrIc2mJmXPamS9zRgtbNbcTOYs82Yt3FWZg2jmWVWiOaBo1JU_DFehRvn9MzFhppDxifDNt_o2uY0Bi5ZMgoDvujT-2f7Q3lm84-0lfFwlT6OfdZ_dMs_zkpLxNrwZpEN4RDk/s1600/First+Part.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="402" data-original-width="402" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhASez195HrIc2mJmXPamS9zRgtbNbcTOYs82Yt3FWZg2jmWVWiOaBo1JU_DFehRvn9MzFhppDxifDNt_o2uY0Bi5ZMgoDvujT-2f7Q3lm84-0lfFwlT6OfdZ_dMs_zkpLxNrwZpEN4RDk/s320/First+Part.png" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
<div>
<div>
The code for steps 16 to 27 is shown below:</div>
<div>
<br /></div>
<div>
turtle.begin_fill()</div>
<div>
turtle.penup()</div>
<div>
turtle.setposition(0, 190)</div>
<div>
turtle.pendown()</div>
<div>
turtle.setheading(225)</div>
<div>
turtle.forward(length)</div>
<div>
turtle.setheading(90)</div>
<div>
turtle.forward(95)</div>
<div>
turtle.setheading(0)</div>
<div>
turtle.forward(190)</div>
<div>
turtle.setheading(90)</div>
<div>
turtle.forward(95)</div>
<div>
turtle.end_fill()</div>
<div>
<br /></div>
<div>
The generated image is shown below:</div>
</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg17sQztzArbVoPooCVViCcfC6Bwamb8DMaQKfq3z60oYzMh3S5Xmv8CRUlpjGNMgV9Bq6Uwp8-HAsnCu4A2jRLhJkX-2eIvMdgazHX9tPZy6k0d16Fik7oodUGBCNTyVZUK8eX3iJ3rfI/s1600/Upper+Left.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="402" data-original-width="402" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg17sQztzArbVoPooCVViCcfC6Bwamb8DMaQKfq3z60oYzMh3S5Xmv8CRUlpjGNMgV9Bq6Uwp8-HAsnCu4A2jRLhJkX-2eIvMdgazHX9tPZy6k0d16Fik7oodUGBCNTyVZUK8eX3iJ3rfI/s320/Upper+Left.png" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
<div>
<div>
The rest is easy. We simply need to move the turtle to where we want it to be in order to draw the other parts of the symbol.</div>
<div>
<br /></div>
<div>
We will move to the upper right quadrant and draw the first half of the symbol in that quadrant. The code to do this is shown below:</div>
<div>
<br /></div>
<div>
turtle.begin_fill()</div>
<div>
turtle.penup()</div>
<div>
turtle.setposition(95, 95)</div>
<div>
turtle.setposition(0, 190)</div>
<div>
turtle.pendown()</div>
<div>
turtle.setheading(315)</div>
<div>
turtle.forward(length)</div>
<div>
turtle.setheading(180)</div>
<div>
turtle.forward(95)</div>
<div>
turtle.setheading(90)</div>
<div>
turtle.forward(190)</div>
<div>
turtle.setheading(180)</div>
<div>
turtle.forward(95)</div>
<div>
turtle.end_fill()</div>
<div>
<br /></div>
<div>
The generated image is shown below:</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8JuBZCxVe-slWCoP9Af6MuCpWsZjTMeYDSu2eKhvf5gtsYxpF5D2uvldQzaaUgeUyJvCFmBx-kLnRhRDeo1rdAsjYUhXEZDY72ulkEAh8W2xzBzb0SpZektEKdHFq3XdEhGRBPrW1UNI/s1600/Upper+Right+First+Part.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="403" data-original-width="403" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8JuBZCxVe-slWCoP9Af6MuCpWsZjTMeYDSu2eKhvf5gtsYxpF5D2uvldQzaaUgeUyJvCFmBx-kLnRhRDeo1rdAsjYUhXEZDY72ulkEAh8W2xzBzb0SpZektEKdHFq3XdEhGRBPrW1UNI/s320/Upper+Right+First+Part.png" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
</div>
<div>
<div>
The code to complete the upper left quadrant is shown below:</div>
<div>
<br /></div>
<div>
turtle.penup()</div>
<div>
turtle.begin_fill()</div>
<div>
turtle.setposition(190, 190)</div>
<div>
turtle.pendown()</div>
<div>
turtle.setheading(225)</div>
<div>
turtle.forward(length)</div>
<div>
turtle.setheading(90)</div>
<div>
turtle.forward(95)</div>
<div>
turtle.setheading(0)</div>
<div>
turtle.forward(190)</div>
<div>
turtle.setheading(90)</div>
<div>
turtle.forward(95)</div>
<div>
turtle.end_fill()</div>
<div>
<br /></div>
<div>
The generated image is shown below:</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFS4gwHzkIYBaK4IUytY29cTfH9vcLZtyImKtSqZbfsjQsyOvHH-c9hyro_TEs1bJZNDXpkm2FK6M97CNXv2pulIfFwCH1sZ7GWJm-XsGCYGS1uD1ctd946bxUzzB0XRrNTnzGO2O3BcI/s1600/Upper+Right.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="402" data-original-width="402" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFS4gwHzkIYBaK4IUytY29cTfH9vcLZtyImKtSqZbfsjQsyOvHH-c9hyro_TEs1bJZNDXpkm2FK6M97CNXv2pulIfFwCH1sZ7GWJm-XsGCYGS1uD1ctd946bxUzzB0XRrNTnzGO2O3BcI/s320/Upper+Right.png" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
</div>
<div>
<div>
From this stage onwards, I will batch together the code that draws the remaining quadrants.</div>
<div>
<br /></div>
<div>
The code to draw the lower right part is shown below:</div>
<div>
<br /></div>
<div>
turtle.begin_fill()</div>
<div>
turtle.penup()</div>
<div>
turtle.setposition(0, 0)</div>
<div>
turtle.pendown()</div>
<div>
turtle.setheading(315)</div>
<div>
turtle.forward(length)</div>
<div>
turtle.setheading(180)</div>
<div>
turtle.forward(95)</div>
<div>
turtle.setheading(90)</div>
<div>
turtle.forward(190)</div>
<div>
turtle.setheading(180)</div>
<div>
turtle.forward(95)</div>
<div>
turtle.end_fill()</div>
<div>
<br /></div>
<div>
turtle.penup()</div>
<div>
turtle.begin_fill()</div>
<div>
turtle.setposition(190, 0)</div>
<div>
turtle.pendown()</div>
<div>
turtle.setheading(225)</div>
<div>
turtle.forward(length)</div>
<div>
turtle.setheading(90)</div>
<div>
turtle.forward(95)</div>
<div>
turtle.setheading(0)</div>
<div>
turtle.forward(190)</div>
<div>
turtle.setheading(90)</div>
<div>
turtle.forward(95)</div>
<div>
turtle.end_fill()</div>
<div>
<br /></div>
<div>
The generated image is shown below:</div>
<div>
<br /></div>
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh5l02LOyyifCuV_OlKPC5XjnSrUG_IuDlpdFOaKYHQr1HtDKIYwZjXf7AbBFBUWEyia9E-p3Ks5mQ53Hvz7RaAxq5qMaO_Q6VXE6St6jXcvp9nWU5Y7E-7x2Nl4CSnLLXfCerWBIf1lzg/s1600/Lower+Right.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="401" data-original-width="401" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh5l02LOyyifCuV_OlKPC5XjnSrUG_IuDlpdFOaKYHQr1HtDKIYwZjXf7AbBFBUWEyia9E-p3Ks5mQ53Hvz7RaAxq5qMaO_Q6VXE6St6jXcvp9nWU5Y7E-7x2Nl4CSnLLXfCerWBIf1lzg/s320/Lower+Right.png" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
<div>
<div class="MsoNormal" style="line-height: 114%; margin-bottom: 0pt; margin-left: 0pt; margin-right: 0pt; text-indent: 0pt;">
<span style="font-size: 12pt; line-height: 114%;">The code to draw the lower left symbol is shown below:</span><span style="font-size: 12pt; line-height: 114%;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 114%; margin-bottom: 0pt; margin-left: 0pt; margin-right: 0pt; text-indent: 0pt;">
<br /></div>
<div class="MsoNormal" style="line-height: 114%; margin-bottom: 0pt; margin-left: 0pt; margin-right: 0pt; text-indent: 0pt;">
<span style="font-size: 12pt; line-height: 114%;">turtle.begin_fill()</span><span style="font-size: 12pt; line-height: 114%;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 114%; margin-bottom: 0pt; margin-left: 0pt; margin-right: 0pt; text-indent: 0pt;">
<span style="font-size: 12pt; line-height: 114%;">turtle.penup()</span><span style="font-size: 12pt; line-height: 114%;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 114%; margin-bottom: 0pt; margin-left: 0pt; margin-right: 0pt; text-indent: 0pt;">
<span style="font-size: 12pt; line-height: 114%;">turtle.setposition(-190, 0)</span><span style="font-size: 12pt; line-height: 114%;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 114%; margin-bottom: 0pt; margin-left: 0pt; margin-right: 0pt; text-indent: 0pt;">
<span style="font-size: 12pt; line-height: 114%;">turtle.pendown()</span><span style="font-size: 12pt; line-height: 114%;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 114%; margin-bottom: 0pt; margin-left: 0pt; margin-right: 0pt; text-indent: 0pt;">
<span style="font-size: 12pt; line-height: 114%;">turtle.setheading(315)</span><span style="font-size: 12pt; line-height: 114%;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 114%; margin-bottom: 0pt; margin-left: 0pt; margin-right: 0pt; text-indent: 0pt;">
<span style="font-size: 12pt; line-height: 114%;">turtle.forward(length)</span><span style="font-size: 12pt; line-height: 114%;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 114%; margin-bottom: 0pt; margin-left: 0pt; margin-right: 0pt; text-indent: 0pt;">
<span style="font-size: 12pt; line-height: 114%;">turtle.setheading(180)</span><span style="font-size: 12pt; line-height: 114%;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 114%; margin-bottom: 0pt; margin-left: 0pt; margin-right: 0pt; text-indent: 0pt;">
<span style="font-size: 12pt; line-height: 114%;">turtle.forward(95)</span><span style="font-size: 12pt; line-height: 114%;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 114%; margin-bottom: 0pt; margin-left: 0pt; margin-right: 0pt; text-indent: 0pt;">
<span style="font-size: 12pt; line-height: 114%;">turtle.setheading(90)</span><span style="font-size: 12pt; line-height: 114%;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 114%; margin-bottom: 0pt; margin-left: 0pt; margin-right: 0pt; text-indent: 0pt;">
<span style="font-size: 12pt; line-height: 114%;">turtle.forward(190)</span><span style="font-size: 12pt; line-height: 114%;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 114%; margin-bottom: 0pt; margin-left: 0pt; margin-right: 0pt; text-indent: 0pt;">
<span style="font-size: 12pt; line-height: 114%;">turtle.setheading(180)</span><span style="font-size: 12pt; line-height: 114%;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 114%; margin-bottom: 0pt; margin-left: 0pt; margin-right: 0pt; text-indent: 0pt;">
<span style="font-size: 12pt; line-height: 114%;">turtle.forward(95)</span><span style="font-size: 12pt; line-height: 114%;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 114%; margin-bottom: 0pt; margin-left: 0pt; margin-right: 0pt; text-indent: 0pt;">
<span style="font-size: 12pt; line-height: 114%;">turtle.end_fill()</span><span style="font-size: 12pt; line-height: 114%;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 114%; margin-bottom: 0pt; margin-left: 0pt; margin-right: 0pt; text-indent: 0pt;">
<br /></div>
<div class="MsoNormal" style="line-height: 114%; margin-bottom: 0pt; margin-left: 0pt; margin-right: 0pt; text-indent: 0pt;">
<span style="font-size: 12pt; line-height: 114%;">turtle.penup()</span><span style="font-size: 12pt; line-height: 114%;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 114%; margin-bottom: 0pt; margin-left: 0pt; margin-right: 0pt; text-indent: 0pt;">
<span style="font-size: 12pt; line-height: 114%;">turtle.begin_fill()</span><span style="font-size: 12pt; line-height: 114%;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 114%; margin-bottom: 0pt; margin-left: 0pt; margin-right: 0pt; text-indent: 0pt;">
<span style="font-size: 12pt; line-height: 114%;">turtle.setposition(0, 0)</span><span style="font-size: 12pt; line-height: 114%;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 114%; margin-bottom: 0pt; margin-left: 0pt; margin-right: 0pt; text-indent: 0pt;">
<span style="font-size: 12pt; line-height: 114%;">turtle.pendown()</span><span style="font-size: 12pt; line-height: 114%;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 114%; margin-bottom: 0pt; margin-left: 0pt; margin-right: 0pt; text-indent: 0pt;">
<span style="font-size: 12pt; line-height: 114%;">turtle.setheading(225)</span><span style="font-size: 12pt; line-height: 114%;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 114%; margin-bottom: 0pt; margin-left: 0pt; margin-right: 0pt; text-indent: 0pt;">
<span style="font-size: 12pt; line-height: 114%;">turtle.forward(length)</span><span style="font-size: 12pt; line-height: 114%;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 114%; margin-bottom: 0pt; margin-left: 0pt; margin-right: 0pt; text-indent: 0pt;">
<span style="font-size: 12pt; line-height: 114%;">turtle.setheading(90)</span><span style="font-size: 12pt; line-height: 114%;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 114%; margin-bottom: 0pt; margin-left: 0pt; margin-right: 0pt; text-indent: 0pt;">
<span style="font-size: 12pt; line-height: 114%;">turtle.forward(95)</span><span style="font-size: 12pt; line-height: 114%;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 114%; margin-bottom: 0pt; margin-left: 0pt; margin-right: 0pt; text-indent: 0pt;">
<span style="font-size: 12pt; line-height: 114%;">turtle.setheading(0)</span><span style="font-size: 12pt; line-height: 114%;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 114%; margin-bottom: 0pt; margin-left: 0pt; margin-right: 0pt; text-indent: 0pt;">
<span style="font-size: 12pt; line-height: 114%;">turtle.forward(190)</span><span style="font-size: 12pt; line-height: 114%;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 114%; margin-bottom: 0pt; margin-left: 0pt; margin-right: 0pt; text-indent: 0pt;">
<span style="font-size: 12pt; line-height: 114%;">turtle.setheading(90)</span><span style="font-size: 12pt; line-height: 114%;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 114%; margin-bottom: 0pt; margin-left: 0pt; margin-right: 0pt; text-indent: 0pt;">
<span style="font-size: 12pt; line-height: 114%;">turtle.forward(95)</span><span style="font-size: 12pt; line-height: 114%;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 114%; margin-bottom: 0pt; margin-left: 0pt; margin-right: 0pt; text-indent: 0pt;">
<span style="font-size: 12pt; line-height: 114%;">turtle.end_fill()</span><span style="font-size: 12pt; line-height: 114%;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 114%; margin-bottom: 0pt; margin-left: 0pt; margin-right: 0pt; text-indent: 0pt;">
<br /></div>
<div class="MsoNormal">
<span style="font-size: 12pt;">The generated symbol is shown below:</span></div>
<div class="MsoNormal">
<span style="font-size: 12pt;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjiRM0mUaeum_YUHWICml7Y0Sl4AQQIAWAE-9wz4cz30SmflR022ZhSUvF6PsWUxeG5JUX7ik5SL0QEynBIsdyRSL_ym8kKAEiXtIs8OVZptK0Qsg2RJUJnQx4bShNcOGXsKNR_liJmKDg/s1600/Final+Symbol.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="403" data-original-width="403" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjiRM0mUaeum_YUHWICml7Y0Sl4AQQIAWAE-9wz4cz30SmflR022ZhSUvF6PsWUxeG5JUX7ik5SL0QEynBIsdyRSL_ym8kKAEiXtIs8OVZptK0Qsg2RJUJnQx4bShNcOGXsKNR_liJmKDg/s320/Final+Symbol.png" width="320" /></a></div>
<div class="MsoNormal" style="text-align: center;">
<span style="font-size: 12pt;"><br /></span></div>
<div class="MsoNormal">
<u>Conclusion</u></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
In this section we cover how to draw the Kyemfere symbol using the Python programming language.</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
</div>
<div class="MsoNormal">
This post is part of the series: <a href="http://trustonteachestech.blogspot.com.ng/p/drawing-adinkra-symbols-using-python.html" target="_blank">Drawing Adinkra Symbols using Python</a>. The goal is to draw 40 Adinkra symbols using the Python programming language.</div>
</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7654257377456795992.post-72776727864690026652018-05-04T06:58:00.002-07:002018-05-04T06:58:26.401-07:00Owia A Repue<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKeuUvzSv5ISs5IWQf6HkglOsB1fuJeJWfQHtEe0uf59tuRk9VJPdge3sZV8ZDRtaUecndCNqOI9FhktXkNOwJykPzQmJPsQQEW3JmauVGVHGGD__lGVC1D1X6Wv7dX1H4KcCIPzvGq6M/s1600/Owia+A+Repue.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="200" data-original-width="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKeuUvzSv5ISs5IWQf6HkglOsB1fuJeJWfQHtEe0uf59tuRk9VJPdge3sZV8ZDRtaUecndCNqOI9FhktXkNOwJykPzQmJPsQQEW3JmauVGVHGGD__lGVC1D1X6Wv7dX1H4KcCIPzvGq6M/s1600/Owia+A+Repue.png" /></a></div>
<div style="text-align: center;">
<br /></div>
Owia A Repue means "Rising Sun". It is the symbol of progress, renewal, development, warmth, vitality, and energy.<br />
<br />
We will use the 5 pixel grid to trace out this image. The image of this is shown below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6q_v48D_ENPAxYtdYAkv7p3VYUR6f0MXVdlNFRQVoyYTHLDILoVK3IANJx_mWe7MT3cj7GSxqijGRZrMKr3jzz7q8AC97fwRCOUKc7t2xgoRt5nGnXufaoAojlj8o06wUtNQO03AI39I/s1600/Grid.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="200" data-original-width="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6q_v48D_ENPAxYtdYAkv7p3VYUR6f0MXVdlNFRQVoyYTHLDILoVK3IANJx_mWe7MT3cj7GSxqijGRZrMKr3jzz7q8AC97fwRCOUKc7t2xgoRt5nGnXufaoAojlj8o06wUtNQO03AI39I/s1600/Grid.png" /></a></div>
<div style="text-align: center;">
<br /></div>
The plan to draw this shape is given below:<br />
<br />
<ol>
<li>Lift up the mouse</li>
<li>Place the turtle at the left tip of the symbol</li>
<li>Find the angle and length between the position of the turtle and the next point.</li>
<li>Draw a line from the left tip to the next point</li>
<li>Move the turtle to the next point</li>
<li>Continue steps 3 to 5 until you get to the middle point of the shape</li>
<li>Draw the rest of the shape</li>
<li>Fill up the shape</li>
</ol>
<br />
<div>
<u>Using Turtle Graphics</u></div>
<div>
<div>
<br /></div>
<div>
We will use the template.py file and rename it to owia.py.</div>
<div>
<br /></div>
<div>
In all the entire shape is made up of 10 lines on the side before the centre line. We shall name the angles and lengths from 1 to 10.</div>
<div>
<br /></div>
<div>
Starting from the left hand side, we have 11 points of interest. Their coordinates are given below:</div>
</div>
<div>
<ol>
<li>(-180, -145)</li>
<li>(-150, -125)</li>
<li>(-200, -75)</li>
<li>(-150, -75)</li>
<li>(-190, -10)</li>
<li>(-130, -20)</li>
<li>(-165, 55)</li>
<li>(-80, 10)</li>
<li>(-90, 100)</li>
<li>(-30, 50)</li>
<li>(0, 160)</li>
</ol>
<div>
<div>
I think its high time to create a function to find the angle between two points. I will call this function angleBetweenPoints.</div>
<div>
<br /></div>
<div>
The code for this function is shown below:</div>
<div>
<br /></div>
<div>
def angleBetweenPoints(x1, y1, x2, y2):</div>
<div>
myradians = math.atan2(y2 - y1, x2 - x1)</div>
<div>
angle = math.degrees(myradians)</div>
<div>
return angle</div>
<div>
<span style="white-space: pre;"> </span></div>
<div>
Now that we have created our function, we have all we need to complete the drawing of this symbol.</div>
</div>
</div>
<div>
<br /></div>
<div>
<div>
To get the length, we reuse the code for the coordinateDistance function which is shown below:</div>
<div>
<br /></div>
<div>
def coordinateDistance(x1, y1, x2, y2):</div>
<div>
dx = x1 - x2</div>
<div>
dy = y1 - y2</div>
<div>
D = math.sqrt((dx * dx) + (dy * dy))</div>
<div>
return D</div>
<div>
<span style="white-space: pre;"> </span></div>
<div>
The first step in the algorithm is to lift up the turtle. The code to do this is shown below:</div>
</div>
<div>
<br /></div>
<div>
<div>
turtle.penup()</div>
<div>
<br /></div>
<div>
Next we move the turtle to the first position on our list which is (-180, -145). The code to do this is shown below:</div>
<div>
<br /></div>
<div>
turtle.setposition(-180, -145)</div>
<div>
<br /></div>
<div>
We find the angle and the length between the first and second position using the code shown below:</div>
<div>
<br /></div>
<div>
angle1 = angleBetweenPoints(-180, -145, -150, -125)</div>
<div>
length1 = coordinateDistance(-180, -145, -150, -125)</div>
<div>
<br /></div>
<div>
We do this for the rest of the angles and lengths of the symbol. The code for this is shown below:</div>
<div>
<br /></div>
<div>
angle2 = angleBetweenPoints(-150, -125, -200, -75)</div>
<div>
length2 = coordinateDistance(-150, -125, -200, -75)</div>
<div>
<br /></div>
<div>
angle3 = angleBetweenPoints(-200, -75, -150, -75)</div>
<div>
length3 = coordinateDistance(-200, -75, -150, -75)</div>
<div>
<br /></div>
<div>
angle4 = angleBetweenPoints(-150, -75, -190, -10)</div>
<div>
length4 = coordinateDistance(-150, -75, -190, -10)</div>
<div>
<br /></div>
<div>
angle5 = angleBetweenPoints(-190, -10, -130, -20)</div>
<div>
length5 = coordinateDistance(-190, -10, -130, -20)</div>
<div>
<br /></div>
<div>
angle6 = angleBetweenPoints(-130, -20, -165, 55)</div>
<div>
length6 = coordinateDistance(-130, -20, -165, 55)</div>
<div>
<br /></div>
<div>
angle7 = angleBetweenPoints(-165, 55, -80, 10)</div>
<div>
length7 = coordinateDistance(-165, 55, -80, 10)</div>
<div>
<br /></div>
<div>
angle8 = angleBetweenPoints(-80, 10, -90, 100)</div>
<div>
length8 = coordinateDistance(-80, 10, -90, 100)</div>
<div>
<br /></div>
<div>
angle9 = angleBetweenPoints(-90, 100, -30, 50)</div>
<div>
length9 = coordinateDistance(-90, 100, -30, 50)</div>
<div>
<br /></div>
<div>
angle10 = angleBetweenPoints(-30, 50, 0, 160)</div>
<div>
length10 = coordinateDistance(-30, 50, 0, 160)</div>
</div>
<div>
<br /></div>
<div>
<div>
Now that we have all the angles we need, we can start drawing the symbol. The code to do this is shown below:</div>
<div>
<br /></div>
<div>
turtle.pendown()</div>
<div>
turtle.begin_fill()</div>
<div>
turtle.setheading(angle1)</div>
<div>
turtle.forward(length1)</div>
<div>
turtle.setheading(angle2)</div>
<div>
turtle.forward(length2)</div>
<div>
turtle.setheading(angle3)</div>
<div>
turtle.forward(length3)</div>
<div>
turtle.setheading(angle4)</div>
<div>
turtle.forward(length4)</div>
<div>
turtle.setheading(angle5)</div>
<div>
turtle.forward(length5)</div>
<div>
turtle.setheading(angle6)</div>
<div>
turtle.forward(length6)</div>
<div>
turtle.setheading(angle7)</div>
<div>
turtle.forward(length7)</div>
<div>
turtle.setheading(angle8)</div>
<div>
turtle.forward(length8)</div>
<div>
turtle.setheading(angle9)</div>
<div>
turtle.forward(length9)</div>
<div>
turtle.setheading(angle10)</div>
<div>
turtle.forward(length10)</div>
<div>
turtle.setheading(360 - angle10)</div>
<div>
turtle.forward(length10)</div>
<div>
turtle.setheading(360 - angle9)</div>
<div>
turtle.forward(length9)</div>
<div>
turtle.setheading(360 - angle8)</div>
<div>
turtle.forward(length8)</div>
<div>
turtle.setheading(360 - angle7)</div>
<div>
turtle.forward(length7)</div>
<div>
turtle.setheading(360 - angle6)</div>
<div>
turtle.forward(length6)</div>
<div>
turtle.setheading(360 - angle5)</div>
<div>
turtle.forward(length5)</div>
<div>
turtle.setheading(360 - angle4)</div>
<div>
turtle.forward(length4)</div>
<div>
turtle.setheading(360 - angle3)</div>
<div>
turtle.forward(length3)</div>
<div>
turtle.setheading(360 - angle2)</div>
<div>
turtle.forward(length2)</div>
<div>
turtle.setheading(360 - angle1)</div>
<div>
turtle.forward(length1)</div>
<div>
turtle.end_fill()</div>
<div>
<br /></div>
<div>
The generated image is shown below:</div>
<div>
<br /></div>
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDETSMW7WIdaB0L_MBjKCM-Uf7ga-JObhKaAIdbLtdFb0soT2Uv7dhoS-zAkF6oSYMJV_FOlk_lUOqTNArbePIh_6NQWji_8fArXlcgxY_tqZEYRw0-qhCCMAR7jw9gC9OCefKFLEiPEo/s1600/Final+Symbol.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="403" data-original-width="403" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDETSMW7WIdaB0L_MBjKCM-Uf7ga-JObhKaAIdbLtdFb0soT2Uv7dhoS-zAkF6oSYMJV_FOlk_lUOqTNArbePIh_6NQWji_8fArXlcgxY_tqZEYRw0-qhCCMAR7jw9gC9OCefKFLEiPEo/s320/Final+Symbol.png" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
<div>
<div>
<u>Conclusion</u></div>
<div>
<br /></div>
<div>
At the end of this section, we have successfully drawn the Owia A Repue symbol. It is the last hard symbol to draw. From this point on, the rest is easy. 3 more to go.</div>
<div>
<br /></div>
<div>
This post is part of the series: <a href="http://trustonteachestech.blogspot.com.ng/p/drawing-adinkra-symbols-using-python.html" target="_blank">Drawing Adinkra Symbols using Python</a>. The goal is to draw 40 Adinkra symbols using the Python programming language.</div>
</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7654257377456795992.post-29464537021850960022018-05-03T07:51:00.000-07:002018-05-03T07:51:39.804-07:00Obohemmaa<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEglFJAJOifWUiJitFBYAxwu0ZGO47kU_dOFRRJcElzI-8K4JWUuY0e79bFi1Z-t4KGKhdQtE4W_N9Ee8Mq3pqmfWHfydL8q698HrpkGyzcW-mq7p1PkdlNj6SmQe3XeDnWBghDBRTl1Lmo/s1600/Obohemmaa.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="200" data-original-width="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEglFJAJOifWUiJitFBYAxwu0ZGO47kU_dOFRRJcElzI-8K4JWUuY0e79bFi1Z-t4KGKhdQtE4W_N9Ee8Mq3pqmfWHfydL8q698HrpkGyzcW-mq7p1PkdlNj6SmQe3XeDnWBghDBRTl1Lmo/s1600/Obohemmaa.png" /></a></div>
<div style="text-align: center;">
<br /></div>
Obohemmaa means "diamond". It is the symbol for precious items.<br />
<br />
We will use the 5 pixel grid to trace out this image. The image of this is shown below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgiM__oGEGRW1UEXix_4sl8_QXxX4jhk3IzlKXCq6BVpSatJhbuVRugOOxeh4dLHb-9822sY31zYZ_Vd3VT5koXd_PtSUy7_IiSYW8rItZrqadpZq1DHIAYUOr6NPYG0OHkiRmNvrRhdkA/s1600/Grid.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="200" data-original-width="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgiM__oGEGRW1UEXix_4sl8_QXxX4jhk3IzlKXCq6BVpSatJhbuVRugOOxeh4dLHb-9822sY31zYZ_Vd3VT5koXd_PtSUy7_IiSYW8rItZrqadpZq1DHIAYUOr6NPYG0OHkiRmNvrRhdkA/s1600/Grid.png" /></a></div>
<div style="text-align: center;">
<br /></div>
The plan to draw this shape is given below:<br />
<br />
<ol>
<li>Lift up the pen</li>
<li>Find the angle and length between the leftmost position and the top of the symbol</li>
<li>Draw the entire shape and fill it</li>
</ol>
<br />
<div>
<u>Using Turtle Graphics</u></div>
<div>
<div>
<br /></div>
<div>
We will use the template.py file and rename it to obohemmaa.py.</div>
<div>
<br /></div>
<div>
The code to lift up the pen is shown below:</div>
<div>
<br /></div>
<div>
turtle.penup()</div>
<div>
<br /></div>
<div>
The coordinate of the leftmost part of the symbol is (-100, 0). The coordinate for the topmost part of the symbol is (0, 200).</div>
<div>
<br /></div>
<div>
The code to find the angle is shown below:</div>
</div>
<div>
<div>
myradians = math.atan2(200 - 0), 0 - (-100))</div>
<div>
angle = math.degrees(myradians)</div>
<div>
<br /></div>
<div>
To find the distance between the two points we use the coordinateDistance function. The code for it is shown below:</div>
</div>
<div>
<br /></div>
<div>
<div>
def coordinateDistance(x1, y1, x2, y2):</div>
<div>
dx = x1 - x2</div>
<div>
dy = y1 - y2</div>
<div>
D = math.sqrt((dx * dx) + (dy * dy))</div>
<div>
return D</div>
<div>
<span style="white-space: pre;"> </span></div>
<div>
We call the function using the code shown below:</div>
<div>
<br /></div>
<div>
length = coordinateDistance(-100, 0, 0, 200)</div>
</div>
<div>
<br /></div>
<div>
<div>
The rest is easy. The code to draw the entire shape is shown below:</div>
<div>
<br /></div>
<div>
turtle.penup()</div>
<div>
turtle.setposition(-100, 0)</div>
<div>
turtle.begin_fill()</div>
<div>
turtle.pendown()</div>
<div>
turtle.setheading(angle)</div>
<div>
turtle.forward(length)</div>
<div>
turtle.setheading(360 - angle)</div>
<div>
turtle.forward(length)</div>
<div>
turtle.setheading(180 + angle)</div>
<div>
turtle.forward(length)</div>
<div>
turtle.setheading(180 - angle)</div>
<div>
turtle.forward(length)</div>
<div>
turtle.end_fill()</div>
<div>
<br /></div>
<div>
The generated image is shown below:</div>
</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh41YeT5mBBoxzL02n6gIoObx3vTcDk2MPun-kdfHr6dvUL0VTpXhX5DN5cYALOdJawPAHcKLHxgPQHrnCFBsSpjP6qcxJdBhlAChDq9Tp9YN0Ywc0gpGz19TrBXdv3pDUdmq5FWaNShEw/s1600/Final+Symbol.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="403" data-original-width="403" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh41YeT5mBBoxzL02n6gIoObx3vTcDk2MPun-kdfHr6dvUL0VTpXhX5DN5cYALOdJawPAHcKLHxgPQHrnCFBsSpjP6qcxJdBhlAChDq9Tp9YN0Ywc0gpGz19TrBXdv3pDUdmq5FWaNShEw/s320/Final+Symbol.png" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
<div>
<div>
<u>Conclusion</u></div>
<div>
<br /></div>
<div>
At the end of this section, we have succeeded in drawing the Obohemmaa symbol.</div>
<div>
<br /></div>
<div>
This post is part of the series: <a href="http://trustonteachestech.blogspot.com.ng/p/drawing-adinkra-symbols-using-python.html" target="_blank">Drawing Adinkra Symbols using Python</a>. The goal is to draw 40 Adinkra symbols using the Python programming language.</div>
</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7654257377456795992.post-52771934128699325492018-05-03T07:23:00.000-07:002018-05-03T07:30:08.612-07:00Nya Gyidie<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjTRqzLIpZyjojcY37zJL-igMMYVaSZSlnu-HXWeTaWsIXGqn7ZscjbY_vMS-ho49rTK0y1ak-Lyi8kXxVaxOXESi_1ZmTIRKCuoVm5EDwq5I4wvpoh8pI_26COWC6IHl9ntOQXDSP7XA/s1600/Nya+Gyidie.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="200" data-original-width="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjTRqzLIpZyjojcY37zJL-igMMYVaSZSlnu-HXWeTaWsIXGqn7ZscjbY_vMS-ho49rTK0y1ak-Lyi8kXxVaxOXESi_1ZmTIRKCuoVm5EDwq5I4wvpoh8pI_26COWC6IHl9ntOQXDSP7XA/s1600/Nya+Gyidie.png" /></a></div>
<div style="text-align: center;">
<br /></div>
Nya Gyidie means "have faith". It is the symbol of faith.<br />
<br />
We will use the 5 pixel grid to trace out this image. The image of this is shown below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhW6VoPnOyuBHkeJzr0aCLZDWBrFzcl9qV9jvbn3a_mlbANsHcrx6tkxY9ovevbKBrWzYOXQKsoI1dZvhh0iUcfqNoL3nfZO6_0Mpg67KXDBLBcxtukuwrcy7u3eaPk64zF2tpAsGiD75w/s1600/Grid.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="200" data-original-width="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhW6VoPnOyuBHkeJzr0aCLZDWBrFzcl9qV9jvbn3a_mlbANsHcrx6tkxY9ovevbKBrWzYOXQKsoI1dZvhh0iUcfqNoL3nfZO6_0Mpg67KXDBLBcxtukuwrcy7u3eaPk64zF2tpAsGiD75w/s1600/Grid.png" /></a></div>
<div style="text-align: center;">
<br /></div>
The plan to draw this shape is given below:<br />
<br />
<ol>
<li>Lift up the pen</li>
<li>Set the pensize to 40</li>
<li>Draw the large circle</li>
<li>Set the pensize to 1</li>
<li>Draw the outer circles</li>
<li>Draw the inner square</li>
<li>Draw the supporting shape</li>
</ol>
<br />
<div>
<u>Using Turtle Graphics</u></div>
<div>
<div>
<br /></div>
<div>
We will use the template.py file and rename it to nya.py.</div>
<div>
<br /></div>
<div>
The for the first two lines is shown below:</div>
</div>
<div>
<div>
turtle.penup()</div>
<div>
turtle.pensize(40)</div>
<div>
<br /></div>
<div>
To draw the large circle we need to move the turtle to the position (120, 0) and draw a circle of radius 120 pixels.</div>
<div>
<br /></div>
<div>
The code to do this is shown below:</div>
<div>
<br /></div>
<div>
turtle.setposition(120, 0)</div>
<div>
turtle.setheading(90)</div>
<div>
turtle.pendown()</div>
<div>
turtle.circle(120)</div>
<div>
<br /></div>
<div>
The image generated is shown below:</div>
<div>
<br /></div>
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhiYyLgHr_rFCBDIS6IoJmVKM9a97YWDowZ_eLADZCFYuXF7ng4Gglw9xx86K5m6RmS5mhgCrgFMeege3HRldCNX5n3SexAUIQH87dFYRE3YTZ6kdahfi4FJDwthaDNjoRmTVPp-W8-PSs/s1600/Large+Circle.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="403" data-original-width="403" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhiYyLgHr_rFCBDIS6IoJmVKM9a97YWDowZ_eLADZCFYuXF7ng4Gglw9xx86K5m6RmS5mhgCrgFMeege3HRldCNX5n3SexAUIQH87dFYRE3YTZ6kdahfi4FJDwthaDNjoRmTVPp-W8-PSs/s320/Large+Circle.png" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
<div>
<div>
To draw the outer circles we need to get the coordinates of the right most sides of the circles.</div>
<div>
<br /></div>
<div>
Starting from the right and moving anticlockwise, they are (190, 0), (25, 165), (-140, 0) and (25, -165).</div>
<div>
<br /></div>
<div>
The code to draw the outer circles is shown below:</div>
<div>
<br /></div>
<div>
turtle.pensize(1)</div>
<div>
<br /></div>
<div>
turtle.penup()</div>
<div>
turtle.begin_fill()</div>
<div>
turtle.setposition(190, 0)</div>
<div>
turtle.setheading(90)</div>
<div>
turtle.pendown()</div>
<div>
turtle.circle(25)</div>
<div>
turtle.end_fill()</div>
<div>
<br /></div>
<div>
turtle.penup()</div>
<div>
turtle.begin_fill()</div>
<div>
turtle.setposition(25, 165)</div>
<div>
turtle.setheading(90)</div>
<div>
turtle.pendown()</div>
<div>
turtle.circle(25)</div>
<div>
turtle.end_fill()</div>
<div>
<br /></div>
<div>
turtle.penup()</div>
<div>
turtle.begin_fill()</div>
<div>
turtle.setposition(-140, 0)</div>
<div>
turtle.setheading(90)</div>
<div>
turtle.pendown()</div>
<div>
turtle.circle(25)</div>
<div>
turtle.end_fill()</div>
<div>
<br /></div>
<div>
turtle.penup()</div>
<div>
turtle.begin_fill()</div>
<div>
turtle.setposition(25, -165)</div>
<div>
turtle.setheading(90)</div>
<div>
turtle.pendown()</div>
<div>
turtle.circle(25)</div>
<div>
turtle.end_fill()</div>
<div>
<br /></div>
<div>
The generated image is shown below:</div>
</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjvF_ouBmridPqa_La4TjXA3ruZIAacddCV4kuq973Otd3b8oKhbFOfusY6vtYp8L3zLUuAp0zCrdDQUE4MQTsogJwDI4UUwV0X9z2R9NUL_jUSeudlQsSOicXL1SqqAkBK74iaionOPXo/s1600/Outer+Circles.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="403" data-original-width="403" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjvF_ouBmridPqa_La4TjXA3ruZIAacddCV4kuq973Otd3b8oKhbFOfusY6vtYp8L3zLUuAp0zCrdDQUE4MQTsogJwDI4UUwV0X9z2R9NUL_jUSeudlQsSOicXL1SqqAkBK74iaionOPXo/s320/Outer+Circles.png" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
<div>
<div>
To draw the inner square, we need to move our turtle to the leftmost part of the square and find the angle as well as the length of the side.</div>
<div>
<br /></div>
<div>
The coordinate for the leftmost side is (-50, 0) while the coordinate for the uppermost part is (0, 50).</div>
<div>
<br /></div>
<div>
The code to find the angle between the two points is shown below:</div>
<div>
<br /></div>
<div>
myradians = math.atan2(50 - (0), 0 - (-50))</div>
<div>
angle = math.degrees(myradians)</div>
<div>
<br /></div>
<div>
To find the length between the two sides, we need to use the coordinateDistance function. The code for it is shown below:</div>
<div>
<br /></div>
<div>
def coordinateDistance(x1, y1, x2, y2):</div>
<div>
dx = x1 - x2</div>
<div>
dy = y1 - y2</div>
<div>
D = math.sqrt((dx * dx) + (dy * dy))</div>
<div>
return D</div>
<div>
<span style="white-space: pre;"> </span></div>
<div>
We call the function using the code shown below:</div>
<div>
<br /></div>
<div>
length = coordinateDistance(-50, 0, 0, 50)</div>
<div>
<br /></div>
<div>
The code to draw the square is shown below:</div>
</div>
<div>
<br /></div>
<div>
<div>
turtle.penup()</div>
<div>
turtle.setposition(-50, 0)</div>
<div>
turtle.begin_fill()</div>
<div>
turtle.pendown()</div>
<div>
turtle.setheading(angle)</div>
<div>
turtle.forward(length)</div>
<div>
turtle.setheading(360 - angle)</div>
<div>
turtle.forward(length)</div>
<div>
turtle.setheading(180 + angle)</div>
<div>
turtle.forward(length)</div>
<div>
turtle.setheading(90 + angle)</div>
<div>
turtle.forward(length)</div>
<div>
turtle.end_fill()</div>
<div>
<br /></div>
<div>
The generated image is shown below:</div>
</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjgrtttUlzprtrtlDa-q_MACpb6xRlEPkPmSm0qWtbzIYY1Pixjo7WphUlh6Dayb9eBypjdJofzu__EaxrWJ1bpPCihCHpfrS8AS3WYsyctnGcZ81WyegqhzecwzxlMK1072vTTkaw_c9w/s1600/Inner+Square.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="403" data-original-width="403" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjgrtttUlzprtrtlDa-q_MACpb6xRlEPkPmSm0qWtbzIYY1Pixjo7WphUlh6Dayb9eBypjdJofzu__EaxrWJ1bpPCihCHpfrS8AS3WYsyctnGcZ81WyegqhzecwzxlMK1072vTTkaw_c9w/s320/Inner+Square.png" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
<div>
<div>
Drawing the upper filled quadrant is not difficult. The quadrant starts at (-40, 90) and heads to the point (0, 50) where it joins the upper tip of the inner square.</div>
<div>
<br /></div>
<div>
To draw this quadrant we move the pen to the position (-40, 90) and draw a line to the point (0, 50). Then we draw the line back to the point (40, 90) where the quadrant ends. The fill property of Python turtle will fill the quadrant for us.</div>
<div>
<br /></div>
<div>
The code to do this is shown below:</div>
</div>
<div>
<br /></div>
<div>
<div>
turtle.setposition(-40, 90)</div>
<div>
turtle.pendown()</div>
<div>
turtle.begin_fill()</div>
<div>
turtle.setheading(inclineAngle)</div>
<div>
turtle.forward(inclineLength)</div>
<div>
turtle.setheading(360 - inclineAngle)</div>
<div>
turtle.forward(inclineLength)</div>
<div>
turtle.end_fill()</div>
<div>
<br /></div>
<div>
The generated image is shown below:</div>
</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjFk2nlGoDAOgtR61MXRdfgVaOiNT_2BRx-DPkWOjTtlAefcNLdYGoBm0X40XXS7K8NFGamzlvRHaqPPJD6Jz_XpGkcM1Hq9ggHtbsT6o854ME9A6jlo-nWbrxyuftqhEgxh191of0YjN8/s1600/Upper+Triangle.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="403" data-original-width="403" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjFk2nlGoDAOgtR61MXRdfgVaOiNT_2BRx-DPkWOjTtlAefcNLdYGoBm0X40XXS7K8NFGamzlvRHaqPPJD6Jz_XpGkcM1Hq9ggHtbsT6o854ME9A6jlo-nWbrxyuftqhEgxh191of0YjN8/s320/Upper+Triangle.png" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
<div>
<div>
To draw the lower filled quadrant, we need to use the same principles we use to draw the top quadrant.</div>
<div>
<br /></div>
<div>
The code for this is shown below:</div>
<div>
<br /></div>
<div>
turtle.penup()</div>
<div>
turtle.setposition(-40, -90)</div>
<div>
turtle.pendown()</div>
<div>
turtle.begin_fill()</div>
<div>
turtle.setheading(360 - inclineAngle)</div>
<div>
turtle.forward(inclineLength)</div>
<div>
turtle.setheading(360 + inclineAngle)</div>
<div>
turtle.forward(inclineLength)</div>
<div>
turtle.end_fill()</div>
<div>
<br /></div>
<div>
The generated image is shown below:</div>
</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqjdj6D4N19R0SxsEjhMvFJsNLSA4jUhtw7WXQzg7Bvh12LwC5S522atRUPaWZk_LEOzkjNkIMtEQXRV_ju6BUHUh1pCs2Y1VXw8U0qoeycor42ju1fWVuw6yoXE3OmhtrqhfQUSeM2Xo/s1600/Lower+Triangle.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="403" data-original-width="403" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqjdj6D4N19R0SxsEjhMvFJsNLSA4jUhtw7WXQzg7Bvh12LwC5S522atRUPaWZk_LEOzkjNkIMtEQXRV_ju6BUHUh1pCs2Y1VXw8U0qoeycor42ju1fWVuw6yoXE3OmhtrqhfQUSeM2Xo/s320/Lower+Triangle.png" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
<div>
<br /></div>
<div>
<div>
To close the gaps in the shape we need to use the fill property.</div>
<div>
<br /></div>
<div>
Move the turtle back to the position of the right hand of the upper triangle. Set the heading to 90 degrees and move forward by 10 pixels.</div>
<div>
<br /></div>
<div>
The code to do this is shown below:</div>
<div>
<br /></div>
<div>
turtle.penup()</div>
<div>
turtle.setposition(40, 90)</div>
<div>
turtle.setheading(90)</div>
<div>
turtle.pendown()</div>
<div>
turtle.begin_fill()</div>
<div>
turtle.forward(10)</div>
<div>
turtle.left(90)</div>
<div>
turtle.forward(80)</div>
<div>
turtle.left(90)</div>
<div>
turtle.forward(10)</div>
<div>
turtle.left(90)</div>
<div>
turtle.forward(80)</div>
<div>
turtle.end_fill()</div>
<div>
<br /></div>
<div>
The generated image is shown below:</div>
</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjd22n4u1ySjG1WHVNXjJSiS219CUMJ0IUSW9xe6DuivFMjOhBiuaHpiUY0GZH6MMxEC2l-lg9Ttsk92rEygovL2W5VEXAnL0dpNv-2HEqlY0ScIAIz5q6ycKSZ4OhVseDQbfyd1FwRNEQ/s1600/Upper+Filled+Quadrant.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="403" data-original-width="403" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjd22n4u1ySjG1WHVNXjJSiS219CUMJ0IUSW9xe6DuivFMjOhBiuaHpiUY0GZH6MMxEC2l-lg9Ttsk92rEygovL2W5VEXAnL0dpNv-2HEqlY0ScIAIz5q6ycKSZ4OhVseDQbfyd1FwRNEQ/s320/Upper+Filled+Quadrant.png" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
<div>
<div>
The code to draw the lower filled quadrant is shown below:</div>
<div>
<br /></div>
<div>
turtle.penup()</div>
<div>
turtle.setposition(-40, -90)</div>
<div>
turtle.setheading(270)</div>
<div>
turtle.pendown()</div>
<div>
turtle.begin_fill()</div>
<div>
turtle.forward(10)</div>
<div>
turtle.left(90)</div>
<div>
turtle.forward(80)</div>
<div>
turtle.left(90)</div>
<div>
turtle.forward(10)</div>
<div>
turtle.left(90)</div>
<div>
turtle.forward(80)</div>
<div>
turtle.end_fill()</div>
<div>
<br /></div>
<div>
The generated image is shown below:</div>
</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdsr4MBt8_O_qW773dfBLDJFR-jiuIZkAIengIV2xveXjAo7H7Uwzx0pTrsQc3fCglPkGMXlWbkdbQk4vUuwNc0pF7JFzF8MM9jDeuPcbSTuyPX6ulnTq3bl_v29nj5F9ltQJkY098hJ8/s1600/Final+Symbol.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="402" data-original-width="403" height="319" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdsr4MBt8_O_qW773dfBLDJFR-jiuIZkAIengIV2xveXjAo7H7Uwzx0pTrsQc3fCglPkGMXlWbkdbQk4vUuwNc0pF7JFzF8MM9jDeuPcbSTuyPX6ulnTq3bl_v29nj5F9ltQJkY098hJ8/s320/Final+Symbol.png" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
<div>
<div>
Conclusion</div>
<div>
<br /></div>
<div>
At the end of this section we have successfully drawn the Nya Gyidie symbol.</div>
<div>
<br /></div>
<div>
This post is part of the series: <a href="http://trustonteachestech.blogspot.com.ng/p/drawing-adinkra-symbols-using-python.html" target="_blank">Drawing Adinkra Symbols using Python</a>. The goal is to draw 40 Adinkra symbols using the Python programming language.</div>
</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7654257377456795992.post-41730124267153173122018-04-28T08:17:00.000-07:002018-04-28T08:17:53.338-07:00Nteasee<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUkqetNQSl55K5ws8IMiaQkhD9OwZs92xpNBPNLUu-FPdnXF4EEyinlLoaBjGfW_nljO3V6y2Zx8x0lTRVpgV_LKfHLxflP15YZfJrpttpZ2YeJkcXXvLeUPgHfqJOgeuWZqJ83CBD2us/s1600/Nteasee.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="200" data-original-width="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUkqetNQSl55K5ws8IMiaQkhD9OwZs92xpNBPNLUu-FPdnXF4EEyinlLoaBjGfW_nljO3V6y2Zx8x0lTRVpgV_LKfHLxflP15YZfJrpttpZ2YeJkcXXvLeUPgHfqJOgeuWZqJ83CBD2us/s1600/Nteasee.png" /></a></div>
<div style="text-align: center;">
<br /></div>
Nteasee means "understanding". It is the symbol of understanding and cooperation.<br />
<br />
We will use the 5 pixel grid to trace out this image. The image of this is shown below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjFqkSdqrqrL8S-f0LP3YP6FsH0MDzhPy6EhZ0fCZc5LGGFjQ9yWhqSGq_sx0GNSjfERERgjFHArDpWP6uMeKs2ukaNq3yPw7aE5EW5GTy8kFO5nppw6R6GrchoyxuRAnO-A_h7wSQSPw/s1600/Grid.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="200" data-original-width="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjFqkSdqrqrL8S-f0LP3YP6FsH0MDzhPy6EhZ0fCZc5LGGFjQ9yWhqSGq_sx0GNSjfERERgjFHArDpWP6uMeKs2ukaNq3yPw7aE5EW5GTy8kFO5nppw6R6GrchoyxuRAnO-A_h7wSQSPw/s1600/Grid.png" /></a></div>
<div style="text-align: center;">
<br /></div>
The plan to draw this shape is given below:<br />
<br />
<ol>
<li>Lift up the pen</li>
<li>Set the pensize to 40 pixels</li>
<li>Draw the upper prong</li>
<li>Draw the lower prong</li>
<li>Draw the upper arrow</li>
<li>Draw the lower arrow</li>
<li>Draw the middle hexagon</li>
</ol>
<br />
<div>
Using Turtle Graphics</div>
<div>
<div>
<br /></div>
<div>
We will use the template.py file and rename it to nteasee.py.</div>
<div>
<br /></div>
<div>
The code for the first two steps are shown below:</div>
</div>
<div>
<br /></div>
<div>
<div>
turtle.penup()</div>
<div>
turtle.pensize(40)</div>
<div>
<br /></div>
<div>
To draw the upper prong, we must move the pen to the position (-70, 180). We do this because the pensize is 40 pixels and will take up a space of 20 pixels when it is placed down.</div>
<div>
<br /></div>
<div>
We place the pendown and move forward by 130 pixels, turn left by 90 degrees, move forward by 140 pixels, turn left by 90 degrees and move forward by 130 pixels.</div>
<div>
<br /></div>
<div>
The code to do this is shown below:</div>
<div>
<br /></div>
<div>
<div>
turtle.setheading(270)</div>
<div>
turtle.setposition(-70, 180)</div>
<div>
turtle.pendown()</div>
<div>
turtle.forward(130)</div>
<div>
turtle.left(90)</div>
<div>
turtle.forward(140)</div>
<div>
turtle.left(90)</div>
<div>
turtle.forward(130)</div>
<div>
<br /></div>
<div>
The generated image is shown below:</div>
</div>
</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmCSJAx-9_L-Vq3GO_fFHnRPOBsnLLNfWJMnsGDpXC566RQjUDNIAvJUt4qvAt1zMFwb_z6G42gsB4dabn4wo13yXA2QkpSc7eYQvKIsqSm3oAz9j4wwUmZ9JdoYv6-55ZKM-1Gy9ZMNs/s1600/Upper+Prong.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="403" data-original-width="403" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmCSJAx-9_L-Vq3GO_fFHnRPOBsnLLNfWJMnsGDpXC566RQjUDNIAvJUt4qvAt1zMFwb_z6G42gsB4dabn4wo13yXA2QkpSc7eYQvKIsqSm3oAz9j4wwUmZ9JdoYv6-55ZKM-1Gy9ZMNs/s320/Upper+Prong.png" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
<div>
<div>
To draw the lower prong, we need to use the steps above but modify them for our purposes.</div>
<div>
<br /></div>
<div>
To do this, we move the pen to the position (-70, -180) and we set the heading of the turtle to 90 degrees.</div>
</div>
<div>
<br /></div>
<div>
<div>
Next we move up by 130 pixels, turn right by 90 degrees, move forward by 140 pixels, turn right by 90 degrees and move down by 130 pixels.</div>
<div>
<br /></div>
<div>
The code to do this is shown below:</div>
<div>
<br /></div>
<div>
turtle.penup()</div>
<div>
turtle.setheading(90)</div>
<div>
turtle.setposition(-70, -180)</div>
<div>
turtle.pendown()</div>
<div>
turtle.forward(130)</div>
<div>
turtle.right(90)</div>
<div>
turtle.forward(140)</div>
<div>
turtle.right(90)</div>
<div>
turtle.forward(130)</div>
<div>
<br /></div>
<div>
The generated image is shown below:</div>
</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhULzY17808invHGHemrbA-Ozt2MPnek3gsE6LxwSdq7jdr3P0G9y96znv57HXGV_hNvs0gXOynaD5roABOqNU5-aEcbBAZdKzP4duD5UNA4vZbFPgQd4L_HG3HB3jopCJL1gzdf19pH4k/s1600/Lower+Prong.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="404" data-original-width="404" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhULzY17808invHGHemrbA-Ozt2MPnek3gsE6LxwSdq7jdr3P0G9y96znv57HXGV_hNvs0gXOynaD5roABOqNU5-aEcbBAZdKzP4duD5UNA4vZbFPgQd4L_HG3HB3jopCJL1gzdf19pH4k/s320/Lower+Prong.png" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
<div>
<div>
Drawing the upper arrow is easy. We need to use a filled shape to do this. To start we, we move the turtle to the left position of the arrow.</div>
<div>
<br /></div>
<div>
We must reduce the pensize of the turtle to 1. Next move forward by 60 pixels then turn left by 90 degrees and move forward by 15 pixels.</div>
<div>
<br /></div>
<div>
We need to find the angle between the current position of the turtle and its next position as well as the distance between them.</div>
<div>
<br /></div>
</div>
<div style="text-align: left;">
<div>
Once we have done the above, the rest is easy. All we need to do is reverse the steps and draw the other half of the arrow.</div>
<div>
<br /></div>
<div>
The code to lift up the pen and set its pensize to 1 is shown below:</div>
<div>
<br /></div>
<div>
turtle.penup()</div>
<div>
turtle.pensize(1)</div>
<div>
<br /></div>
<div>
We move the position of the pen to the left side of the arrow as well as change its heading. The code to do this shown below:</div>
<div>
<br /></div>
<div>
turtle.setposition(-20, 70)</div>
<div>
turtle.setheading(90)</div>
<div>
turtle.pendown()</div>
<div>
<br /></div>
<div>
We move forward by 60 pixels, turn left by 90 degrees and move forward by 15 pixels. The code to do this is shown below:</div>
<div>
<br /></div>
<div>
turtle.begin_fill()</div>
<div>
turtle.forward(60)</div>
<div>
turtle.left(90)</div>
<div>
turtle.forward(15)</div>
<div>
<br /></div>
<div>
The current position of the turtle is at (-35, 130). Its next position is (0, 190). To get there, we need to find the angle between the two points. The code to do this is shown below:</div>
<div>
<br /></div>
<div>
myradians = math.atan2(190 - 130, 0 - (-35))</div>
<div>
angle = math.degrees(myradians)</div>
<div>
<br /></div>
<div>
To find the length between the two points, we use the coordinateDistance function. The code for it is shown below:</div>
<div>
<br /></div>
<div>
def coordinateDistance(x1, y1, x2, y2):</div>
<div>
dx = x1 - x2</div>
<div>
dy = y1 - y2</div>
<div>
D = math.sqrt((dx * dx) + (dy * dy))</div>
<div>
return D</div>
<div>
<br /></div>
<div>
We call the function using the code shown below:</div>
<div>
<br /></div>
<div>
length = coordinateDistance(-35, 130, 0, 190)</div>
<div>
<br /></div>
<div>
The code to draw the rest of the arrow is given below:</div>
<div>
<br /></div>
<div>
turtle.setheading(angle)</div>
<div>
turtle.forward(length)</div>
<div>
turtle.setheading(360 - angle)</div>
<div>
turtle.forward(length)</div>
<div>
turtle.setheading(180)</div>
<div>
turtle.forward(15)</div>
<div>
turtle.setheading(270)</div>
<div>
turtle.forward(60)</div>
<div>
turtle.end_fill()</div>
<div>
<br /></div>
<div>
The generated image is shown below:</div>
<div>
<br /></div>
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhtFfGcCGhRLPRVhtA4kKtYViXpns5xYE2Z7PTGwiJFMk-RDB_Zg2DBHj43yrCrY9MdlItnBYKbfGqV4N8_MevTXjpcQGsCjeoEYiLi0gmZT-_J1nM4palHAbgPT4kreRjk7LpnBYgzlUw/s1600/Upper+Arrow.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="403" data-original-width="403" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhtFfGcCGhRLPRVhtA4kKtYViXpns5xYE2Z7PTGwiJFMk-RDB_Zg2DBHj43yrCrY9MdlItnBYKbfGqV4N8_MevTXjpcQGsCjeoEYiLi0gmZT-_J1nM4palHAbgPT4kreRjk7LpnBYgzlUw/s320/Upper+Arrow.png" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
<div>
<div>
To draw the lower part, we need to move the turtle to the position () and reverse the steps above.</div>
<div>
<br /></div>
<div>
The code to do this is shown below:</div>
<div>
<br /></div>
<div>
turtle.penup()</div>
<div>
turtle.setposition(-20, -70)</div>
<div>
turtle.setheading(270)</div>
<div>
turtle.pendown()</div>
<div>
turtle.begin_fill()</div>
<div>
turtle.forward(60)</div>
<div>
turtle.right(90)</div>
<div>
turtle.forward(15)</div>
<div>
turtle.setheading(360-angle)</div>
<div>
turtle.forward(length)</div>
<div>
turtle.setheading(angle)</div>
<div>
turtle.forward(length)</div>
<div>
turtle.setheading(180)</div>
<div>
turtle.forward(15)</div>
<div>
turtle.setheading(90)</div>
<div>
turtle.forward(60)</div>
<div>
turtle.end_fill()</div>
<div>
<br /></div>
<div>
The generated image is shown below:</div>
</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7xS4rSilvc1-k3HWp2eZIcfh73zWu1puvzUnHdYDMT2E0bqm58zXERr0r2_vGKXtf_gJfSnLWpnRPIQK2Hfv_p_B2TUbj5HLPYckGEkoLwJWlwio9QtwwsbNipUJ1tvGDZxAkaz9cthg/s1600/Lower+Arrow.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="403" data-original-width="403" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7xS4rSilvc1-k3HWp2eZIcfh73zWu1puvzUnHdYDMT2E0bqm58zXERr0r2_vGKXtf_gJfSnLWpnRPIQK2Hfv_p_B2TUbj5HLPYckGEkoLwJWlwio9QtwwsbNipUJ1tvGDZxAkaz9cthg/s320/Lower+Arrow.png" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
<div>
<div>
To complete this symbol we need to draw the hexagon.</div>
<div>
<br /></div>
<div>
To do so, we need to move the turtle to the left side of the hexagon. The coordinate of this position is (-20, -30).</div>
<div>
<br /></div>
<div>
The next thing is to find the angle and length between this position and the next position. The coordinates of the next position are (-35, 0).</div>
<div>
<br /></div>
<div>
The code to find the angle and length is given below:</div>
<div>
<br /></div>
<div>
myradians = math.atan2(0 - (-30), -35 - (-20))</div>
<div>
hexAngle = math.degrees(myradians)</div>
<div>
hexLength = coordinateDistance(-20, -30, -35, 0)</div>
<div>
<br /></div>
<div>
The code to draw the hexagon is given below:</div>
<div>
<br /></div>
<div>
turtle.penup()</div>
<div>
turtle.setposition(-20, -30)</div>
<div>
turtle.setheading(hexAngle)</div>
<div>
turtle.pendown()</div>
<div>
turtle.begin_fill()</div>
<div>
turtle.forward(hexLength)</div>
<div>
turtle.setheading(180 - hexAngle)</div>
<div>
turtle.forward(hexLength)</div>
<div>
turtle.setheading(0)</div>
<div>
turtle.forward(40)</div>
<div>
turtle.setheading(360 - (180 - hexAngle))</div>
<div>
turtle.forward(hexLength)</div>
<div>
turtle.setheading(360 - hexAngle)</div>
<div>
turtle.forward(hexLength)</div>
<div>
turtle.setheading(180)</div>
<div>
turtle.forward(40)</div>
<div>
turtle.end_fill()</div>
<div>
<br /></div>
<div>
The generated image is shown below:</div>
</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3fEtsTDulzVoooypWiHWIyyJpkOjq4_t5dxXT7IKtFpmyb_42OniM54qtRyeu3y5be8nKs0P08GmEa60fufIgh0lfUvrf0s25kZeQooFyc1KYivmt0x5V66A_m30QqyfEpFekHV5AU14/s1600/Final+Symbol.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="403" data-original-width="403" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3fEtsTDulzVoooypWiHWIyyJpkOjq4_t5dxXT7IKtFpmyb_42OniM54qtRyeu3y5be8nKs0P08GmEa60fufIgh0lfUvrf0s25kZeQooFyc1KYivmt0x5V66A_m30QqyfEpFekHV5AU14/s320/Final+Symbol.png" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
<div>
<div>
Conclusion</div>
<div>
<br /></div>
<div>
At the end of this section, we have successfully drawn the Nteasee symbol.</div>
<div>
<br /></div>
<div>
This post is part of the series: <a href="http://trustonteachestech.blogspot.com.ng/p/drawing-adinkra-symbols-using-python.html" target="_blank">Drawing Adinkra Symbols using Python</a>. The goal is to draw 40 Adinkra symbols using the Python programming language.</div>
</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7654257377456795992.post-54408712801156642512018-04-25T05:07:00.000-07:002018-04-25T05:07:48.294-07:00Nsoromma<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzufHIpnkkq-6Edi-h6opyAEH1vZnlPk1MWkiU87yN5mlTQ1tzt83HSYucinq1GfZ8vy7Zw3zON26BBkqymq4ru5r0ra31bx76RC_sMUX65tBQ0lZO8DF735biU8ay7e7a2B2t_Tee5uQ/s1600/Nsoromma.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="200" data-original-width="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzufHIpnkkq-6Edi-h6opyAEH1vZnlPk1MWkiU87yN5mlTQ1tzt83HSYucinq1GfZ8vy7Zw3zON26BBkqymq4ru5r0ra31bx76RC_sMUX65tBQ0lZO8DF735biU8ay7e7a2B2t_Tee5uQ/s1600/Nsoromma.png" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both;">
Nsoromma means "child of the heavens". It is the symbol of guardianship. A reminder that God is the father and watches over all people.</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
We will use the 5 pixel grid to trace out this image. The image of this is shown below:</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHw2UsF5Ks5usn8oQQzJVzouZB_vOIaw5LjD19DPrraLRmtyj1gAi9EvmpA7m15pXzsmYNbixa4JvDn17SUZkk8UVu7BKoYlCOUOmPCo9IrmIxr_r9t4K_Z46LQIdvJJYa_KM8BaSkLSU/s1600/Grid.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="200" data-original-width="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHw2UsF5Ks5usn8oQQzJVzouZB_vOIaw5LjD19DPrraLRmtyj1gAi9EvmpA7m15pXzsmYNbixa4JvDn17SUZkk8UVu7BKoYlCOUOmPCo9IrmIxr_r9t4K_Z46LQIdvJJYa_KM8BaSkLSU/s1600/Grid.png" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both;">
The plan to draw this shape is given below:</div>
<div class="separator" style="clear: both;">
</div>
<ol>
<li>Lift up the pen</li>
<li>Find the angle between the edge of the shape in the lower left quadrant and the top of the shape</li>
<li>Find the distance between the edge of the shape in the lower left quadrant and the top of the shape</li>
<li>Move the pen to the position of the lower left quadrant</li>
<li>Set its heading to the value found in 2</li>
<li>Move forward by the distance found in 3</li>
<li>Continue alternating through steps 5 and 6 until the shape is completed</li>
<li>Fill up the final shape</li>
<li>Move to the rightmost position for the radius of the circle</li>
<li>Draw a filled circle</li>
</ol>
<br />
<div>
<u>Using Turtle Graphics</u></div>
<div>
<div>
<br /></div>
<div>
We will use the template.py file and rename it to nsoromma.py.</div>
<div>
<br /></div>
<div>
Step 1 is easy, we only need to lift up the pen. The code to do this is shown below:</div>
<div>
<br /></div>
<div>
turtle.penup()</div>
<div>
<br /></div>
<div>
For step 2 we need to find the angle between the lower left point of the symbol and its uppermost part. Their respective coordinates are (-140, -140) and (0, 195).</div>
<div>
<br /></div>
<div>
The code to do this is shown below:</div>
</div>
<div>
<br /></div>
<div>
<div>
turtle.penup()</div>
<div>
myradians = math.atan2(195 - (-140), 0 - (-140))</div>
<div>
angle = math.degrees(myradians)</div>
<div>
<br /></div>
<div>
The value of the angle will be used in drawing the entire shape.</div>
</div>
<div>
<br /></div>
<div>
<div>
Next we find the length between the two points using the coordinateDistance function. The code for it is shown below:</div>
<div>
<br /></div>
<div>
def coordinateDistance(x1, y1, x2, y2):</div>
<div>
dx = x1 - x2</div>
<div>
dy = y1 - y2</div>
<div>
D = math.sqrt((dx * dx) + (dy * dy))</div>
<div>
return D</div>
<div>
<br /></div>
<div>
We call the function using the code shown below:</div>
</div>
<div>
<br /></div>
<div>
<div>
length = coordinateDistance(-140, -140, 0, 195)</div>
<div>
<br /></div>
<div>
Steps 4 to 6 are easy enough. But we must use the fill property to draw the shape.</div>
<div>
<br /></div>
<div>
The code for the entire drawing is shown below:</div>
<div>
<br /></div>
</div>
<div>
<div>
turtle.setposition(-140, -140)</div>
<div>
turtle.pendown()</div>
<div>
turtle.begin_fill()</div>
<div>
turtle.setheading(angle)</div>
<div>
turtle.forward(length)</div>
<div>
turtle.setheading(360 - angle)</div>
<div>
turtle.forward(length)</div>
<div>
turtle.setheading(90 + angle)</div>
<div>
turtle.forward(length)</div>
<div>
turtle.setheading(90 - angle)</div>
<div>
turtle.forward(length)</div>
<div>
turtle.setheading(180 + angle)</div>
<div>
turtle.forward(length)</div>
<div>
turtle.setheading(180 - angle)</div>
<div>
turtle.forward(length)</div>
<div>
turtle.setheading(270 + angle)</div>
<div>
turtle.forward(length)</div>
<div>
turtle.setheading(270 - angle)</div>
<div>
turtle.forward(length)</div>
<div>
turtle.end_fill()</div>
</div>
<div>
<br /></div>
<div>
<div>
To really understand what is going on, add each setheading and forward combination gradually.</div>
<div>
<br /></div>
<div>
The generated image is shown below:</div>
<div>
<br /></div>
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitH0U5NSXSuAcbR0gYyA0lV8jOGXMFk_eFO2OpLGbaFWyuuiupoP_zHffH5qhiN8gAA-eOEQ6sQ7adqzLv9yCWHPwgyagJkEEKGm5lKYdbTdp9iQSG6CCd1Aq_NfnVi7eqRoWlPiiNYa0/s1600/Star.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="403" data-original-width="403" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitH0U5NSXSuAcbR0gYyA0lV8jOGXMFk_eFO2OpLGbaFWyuuiupoP_zHffH5qhiN8gAA-eOEQ6sQ7adqzLv9yCWHPwgyagJkEEKGm5lKYdbTdp9iQSG6CCd1Aq_NfnVi7eqRoWlPiiNYa0/s320/Star.png" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
<div>
<br /></div>
<div class="separator" style="clear: both;">
Drawing the circle is easy. We simply move the turtle to the position (50, 0), set its heading to 90 degrees and draw a filled circle.</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
The code to do this is shown below:</div>
<div>
<br /></div>
<div>
<div>
turtle.setposition(50, 0)</div>
<div>
turtle.setheading(90)</div>
<div>
turtle.color("white", "white")</div>
<div>
turtle.begin_fill()</div>
<div>
turtle.circle(50)</div>
<div>
turtle.end_fill()</div>
<div>
<br /></div>
<div>
The generated image is shown below:</div>
</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUfe4GsPr4LQj20ZMZu4E1m-VelB-bGtyLtlw4l76LRl1h9VgV7wjGHq8yi6y3XjXTwdfKE4uQ8PUyUKjVowX-YHbH5ZxzwJeHwuqJtLu_eF1q0qoPgE2zTA7eZxWBhU2ouiwv-roaTAs/s1600/Final+Symbol.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="403" data-original-width="403" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUfe4GsPr4LQj20ZMZu4E1m-VelB-bGtyLtlw4l76LRl1h9VgV7wjGHq8yi6y3XjXTwdfKE4uQ8PUyUKjVowX-YHbH5ZxzwJeHwuqJtLu_eF1q0qoPgE2zTA7eZxWBhU2ouiwv-roaTAs/s320/Final+Symbol.png" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
<div>
<div>
The only code that might appear strange is this line:</div>
<div>
<br /></div>
<div>
turtle.color("white", "white")</div>
<div>
<br /></div>
<div>
The above line makes the pencolor and fillcolor of the turtle white.</div>
<div>
<br /></div>
<div>
<u>Conclusion</u></div>
<div>
<br /></div>
<div>
At the end of this section we have successfully drawn the Nsoromma symbol.</div>
<div>
<br /></div>
<div>
This is my favourite symbol in this series. It has an emergent property. It is made up of triangular shapes that combine to form it.</div>
<div>
<br /></div>
<div>
This post is part of the series: <a href="http://trustonteachestech.blogspot.com.ng/p/drawing-adinkra-symbols-using-python.html" target="_blank">Drawing Adinkra Symbols using Python</a>. The goal is to draw 40 Adinkra symbols using the Python programming language.</div>
</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7654257377456795992.post-41389766880696083752018-04-19T07:46:00.001-07:002018-04-19T07:46:11.483-07:00Nnampo Pa Baanu<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgeMLN3RpKaTpbfgzQRXd1KfzJ04xvYafW6_5TKO_vs1yUHWSnAL-ITumufATDMRkcKcFNZZf2zGr3T4miyq8kZ8SzZlZgGOFVgr_DIsU3Ov19FTB6V5j70BQIa9NsywDcYgYdV1E5Y5dA/s1600/Nnampo+Pa+Baanu.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="200" data-original-width="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgeMLN3RpKaTpbfgzQRXd1KfzJ04xvYafW6_5TKO_vs1yUHWSnAL-ITumufATDMRkcKcFNZZf2zGr3T4miyq8kZ8SzZlZgGOFVgr_DIsU3Ov19FTB6V5j70BQIa9NsywDcYgYdV1E5Y5dA/s1600/Nnampo+Pa+Baanu.png" /></a></div>
<div style="text-align: center;">
<br /></div>
Nnampo Pa Baanu means "two good friends". It is the symbol of friendship.<br />
<br />
We will use the 5 pixel grid to trace out this image. The image of this is shown below:<br />
<div style="text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRI3gR9mnfKDNet93NEHOy9rlyr8KFg25pfQH1bjxjEvS94QOpvzgAkIverjduJsmIfY08UTPG3MgLyVYUOwan7ZDQRX711z-FwryEO59ALRwUt5GKVWmTzM4s5O0GsmCEds85NQlmHHM/s1600/Grid.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="200" data-original-width="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRI3gR9mnfKDNet93NEHOy9rlyr8KFg25pfQH1bjxjEvS94QOpvzgAkIverjduJsmIfY08UTPG3MgLyVYUOwan7ZDQRX711z-FwryEO59ALRwUt5GKVWmTzM4s5O0GsmCEds85NQlmHHM/s1600/Grid.png" /></a></div>
<div style="text-align: center;">
<br /></div>
<div>
The plan to draw this shape is given below:</div>
<div>
<ol>
<li>Lift up the pen</li>
<li>Set the pensize to 40 pixels</li>
<li>Move the pen to the bottom of the location of the center vertical</li>
<li>Draw the center vertical</li>
<li>Set the pensize to 30 pixels</li>
<li>Draw the remaining center verticals</li>
<li>Complete the outline of the shape</li>
<li>Draw the semicircles</li>
</ol>
<div>
<div>
<u>Using Turtle Graphics</u></div>
<div>
<br /></div>
<div>
We will use the template.py file and rename it to nnampo.py.</div>
<div>
<br /></div>
<div>
The code for steps 1 and 2 is given below:</div>
<div>
<br /></div>
<div>
turtle.penup()</div>
<div>
turtle.pensize(40)</div>
<div>
<br /></div>
</div>
</div>
<div>
<div>
The coordinates for the bottom of the center vertical are (0, -80). The length of the line is 160 pixels.</div>
<div>
<br /></div>
<div>
The code to draw this line is shown below:</div>
<div>
<br /></div>
<div>
turtle.setposition(0, -60)</div>
<div>
turtle.pendown()</div>
<div>
turtle.setheading(90)</div>
<div>
turtle.forward(120)</div>
<div>
<br /></div>
<div>
The generated image is shown below:</div>
</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiW-76ATUg_lUdwHW0z0P4HeTk0l7bvOti0-cDm0k3oNQRY7s_RsSoNqkXqt3n7NUynSLPbXIuVpEmCYzdMkhbj_TAoeS0-tLzu9XaKQU2-7X8uwMgLwfcmYszeJapV1Xjr6UJ03xOnLiI/s1600/Center+Lines.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="403" data-original-width="403" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiW-76ATUg_lUdwHW0z0P4HeTk0l7bvOti0-cDm0k3oNQRY7s_RsSoNqkXqt3n7NUynSLPbXIuVpEmCYzdMkhbj_TAoeS0-tLzu9XaKQU2-7X8uwMgLwfcmYszeJapV1Xjr6UJ03xOnLiI/s320/Center+Lines.png" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
<div>
<div>
To draw the remaining center verticals, we must first know their coordinates they are: (-165, 60), (-85, 60), (85, 60) and (165, 60).</div>
<div>
<br /></div>
<div>
The code to draw them is given below:</div>
<div>
<br /></div>
<div>
turtle.pensize(30)</div>
<div>
<br /></div>
<div>
turtle.penup()</div>
<div>
turtle.setposition(-165, -60)</div>
<div>
turtle.pendown()</div>
<div>
turtle.setheading(90)</div>
<div>
turtle.forward(120)</div>
<div>
<br /></div>
<div>
turtle.penup()</div>
<div>
turtle.setposition(-85, -60)</div>
<div>
turtle.pendown()</div>
<div>
turtle.setheading(90)</div>
<div>
turtle.forward(120)</div>
<div>
<br /></div>
<div>
turtle.penup()</div>
<div>
turtle.setposition(85, -60)</div>
<div>
turtle.pendown()</div>
<div>
turtle.setheading(90)</div>
<div>
turtle.forward(120)</div>
<div>
<br /></div>
<div>
turtle.penup()</div>
<div>
turtle.setposition(165, -60)</div>
<div>
turtle.pendown()</div>
<div>
turtle.setheading(90)</div>
<div>
turtle.forward(120)</div>
<div>
<br /></div>
<div>
The generated image is shown below:</div>
<div>
<br /></div>
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgnOisu5e7QuAGS4dRcebVSVkXdg3HAC1tLTLQAlXXGcqfSmqZ1s6gmVQE33w1FG9bBRdVYO1XjZK0zOT0iOqAHWlQGTAAQLoXs6grPzWPnEQNBuLLd6E9UGVRWv1574QULayN937albOY/s1600/Vertical+Centers.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="403" data-original-width="403" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgnOisu5e7QuAGS4dRcebVSVkXdg3HAC1tLTLQAlXXGcqfSmqZ1s6gmVQE33w1FG9bBRdVYO1XjZK0zOT0iOqAHWlQGTAAQLoXs6grPzWPnEQNBuLLd6E9UGVRWv1574QULayN937albOY/s320/Vertical+Centers.png" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
<div>
<div>
To complete the outline of the shape, we need to draw the top horizontal line and the bottom horizontal line.</div>
<div>
<br /></div>
<div>
The coordinate for the upper line is (-165, 75) and its length is 330 pixels. The code to draw it is shown below:</div>
<div>
<br /></div>
<div>
turtle.penup()</div>
<div>
turtle.setposition(-165, 75)</div>
<div>
turtle.pendown()</div>
<div>
turtle.setheading(0)</div>
<div>
turtle.forward(330)</div>
<div>
<br /></div>
<div>
The coordinate for the lower line is (-165, -75). The code to draw it is shown below:</div>
<div>
<br /></div>
<div>
turtle.penup()</div>
<div>
turtle.setposition(-165, -75)</div>
<div>
turtle.pendown()</div>
<div>
turtle.setheading(0)</div>
<div>
turtle.forward(330)</div>
<div>
<br /></div>
<div>
The generated image is shown below:</div>
<div>
<br /></div>
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdW68NdVNkds5eiaoNgCAYWdjZhLtS_VKECymsHRJMJGLbs2vDosYAJeyTxcnTq0cvMDXbAbfrenzPZFj3H3O0v6xu0qcFeQaLR85Ta4QFbtk627B3GgOraz-TY_TKU2wCdVZWxAP9H3E/s1600/Outline.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="404" data-original-width="404" height="319" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdW68NdVNkds5eiaoNgCAYWdjZhLtS_VKECymsHRJMJGLbs2vDosYAJeyTxcnTq0cvMDXbAbfrenzPZFj3H3O0v6xu0qcFeQaLR85Ta4QFbtk627B3GgOraz-TY_TKU2wCdVZWxAP9H3E/s320/Outline.png" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
<div>
<div>
Drawing the semicircles is easy. We need to move the turtle to the position of the rightmost sides and draw the circle.</div>
<div>
<br /></div>
<div>
The code to do this is shown below:</div>
<div>
<br /></div>
<div>
turtle.penup()</div>
<div>
turtle.setposition(165, 75)</div>
<div>
turtle.pendown()</div>
<div>
turtle.setheading(90)</div>
<div>
turtle.circle(80, 180)</div>
<div>
<br /></div>
<div>
turtle.penup()</div>
<div>
turtle.setposition(-5, 75)</div>
<div>
turtle.pendown()</div>
<div>
turtle.setheading(90)</div>
<div>
turtle.circle(80, 180)</div>
<div>
<br /></div>
<div>
The generated image is shown below:</div>
<div>
<br /></div>
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiatGabNKyemLnD_oX4LzWkKYP8Lnee0hK4Ml9BOT_gkVVRvoxJJWwEhrU_rgGMBHL7rInVi4YFG7HsBki7efHbSaDSqb9yIvpqqVibKnKN_gIZZ-F8X-mRZ9Vl9PR6Nb9pAtygDn48hZI/s1600/Upper+Semicircles.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="403" data-original-width="403" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiatGabNKyemLnD_oX4LzWkKYP8Lnee0hK4Ml9BOT_gkVVRvoxJJWwEhrU_rgGMBHL7rInVi4YFG7HsBki7efHbSaDSqb9yIvpqqVibKnKN_gIZZ-F8X-mRZ9Vl9PR6Nb9pAtygDn48hZI/s320/Upper+Semicircles.png" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
<div>
<div>
To draw the lower semicircle we just invert the positions. The code to do this is shown below:</div>
<div>
<br /></div>
<div>
turtle.penup()</div>
<div>
turtle.setposition(-165, -75)</div>
<div>
turtle.pendown()</div>
<div>
turtle.setheading(270)</div>
<div>
turtle.circle(80, 180)</div>
<div>
<br /></div>
<div>
turtle.penup()</div>
<div>
turtle.setposition(5, -75)</div>
<div>
turtle.pendown()</div>
<div>
turtle.setheading(270)</div>
<div>
turtle.circle(80, 180)</div>
<div>
<br /></div>
<div>
The generated image is shown below:</div>
</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgu0tL2sA9hATELAuMvDI5cZLAkwgaQfsH6k60vVHEEN7PruE_Xi37BNWBER1DxrGrbcYzkONQbWNwVcwVzDtjYyPuSIHMtjfrMoc-Q3hHeQonGdbvth82AzcGmJTOOfBLawJHbqhvCr3Y/s1600/Final+Symbol.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="403" data-original-width="403" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgu0tL2sA9hATELAuMvDI5cZLAkwgaQfsH6k60vVHEEN7PruE_Xi37BNWBER1DxrGrbcYzkONQbWNwVcwVzDtjYyPuSIHMtjfrMoc-Q3hHeQonGdbvth82AzcGmJTOOfBLawJHbqhvCr3Y/s320/Final+Symbol.png" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
<div>
<div>
<u>Conclusion</u></div>
<div>
<br /></div>
<div>
At the end of this section we have succeeded in drawing the Nnampo Pa Baanu symbol.</div>
<div>
<br /></div>
<div>
This post is part of the series: <a href="http://trustonteachestech.blogspot.com.ng/p/drawing-adinkra-symbols-using-python.html" target="_blank">Drawing Adinkra Symbols using Python</a>. The goal is to draw 40 Adinkra symbols using the Python programming language.</div>
</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7654257377456795992.post-43807657603425714942018-04-19T06:48:00.000-07:002018-04-19T06:48:31.367-07:00Mrammuo<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhL9uy9uJkqrFAIhGUdVPaaHHsqYySTt_cI002h0giOTxWmK6HNZPMfPKSUc3QbRFi7-HT0Fi0dvbmt2nzOotCsEq7eOwTJw4Up1MgSUi5zjuqBMj8Q_-Q6tRLXgxSl_aDPuSi_0pHEBtc/s1600/Mrammuo.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="200" data-original-width="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhL9uy9uJkqrFAIhGUdVPaaHHsqYySTt_cI002h0giOTxWmK6HNZPMfPKSUc3QbRFi7-HT0Fi0dvbmt2nzOotCsEq7eOwTJw4Up1MgSUi5zjuqBMj8Q_-Q6tRLXgxSl_aDPuSi_0pHEBtc/s1600/Mrammuo.png" /></a></div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: left;">
Mrammuo means "crossing paths". It is the symbol of life challenges.</div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
We will use the 5 pixel grid to trace out this image. The image of this is shown below:</div>
<div style="text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgy6uzgQxvDwCYp5Oaw4UX4UnWbJUGqTcotTWoljS-DKKTIo8MtwWr0TcucrlB1PfnOSZpyTEge8sDokmtar61DEqQjCjufz0FQTm8uHOcqXBG0JaiqiPsUV-77hf_-haN_K3VR2XaM5cc/s1600/Grid.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="200" data-original-width="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgy6uzgQxvDwCYp5Oaw4UX4UnWbJUGqTcotTWoljS-DKKTIo8MtwWr0TcucrlB1PfnOSZpyTEge8sDokmtar61DEqQjCjufz0FQTm8uHOcqXBG0JaiqiPsUV-77hf_-haN_K3VR2XaM5cc/s1600/Grid.png" /></a></div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: left;">
The plan to draw this shape is given below:</div>
<div style="text-align: left;">
</div>
<ol>
<li>Lift up the pen</li>
<li>Set the pensize to 15 pixels</li>
<li>Draw the outer box</li>
<li>Draw the inner diagonals</li>
<li>Draw the serrated edges</li>
</ol>
<br />
<div>
<u>Using Turtle Graphics</u></div>
<div>
<div>
<br /></div>
<div>
We will use the template.py file and rename it to mrammuo.py.</div>
<div>
<br /></div>
<div>
The code to lift up the pen and set the pensize is shown below:</div>
<div>
<br /></div>
<div>
turtle.penup()</div>
<div>
turtle.pensize(15)</div>
</div>
<div>
<br /></div>
<div>
<div>
The upper left coordinate for the outer box is (-175, 105). Its length is 350. The code to draw this line is given below:</div>
<div>
<br /></div>
<div>
turtle.setposition(-175, 105)</div>
<div>
turtle.pendown()</div>
<div>
turtle.forward(350)</div>
<div>
<br /></div>
<div>
We do the same for the lower part of the outer box. The code to do this is shown below:</div>
<div>
<br /></div>
<div>
turtle.penup()</div>
<div>
turtle.setposition(-175, -105)</div>
<div>
turtle.pendown()</div>
<div>
turtle.forward(350)</div>
<div>
<br /></div>
<div>
The generated image is shown below:</div>
</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSSi6T2phz-4aUuUW53I6XGOQR-JWTrFrZB8F46Ugw6LQQvW_F4ixML1CksCBZwveJfz6A4rlk0DEXuueT86L26WISio538_5zepwhL4PPVS4lv1WSbotigy3jJVRIxUegLCBursLCtpk/s1600/Parallel+Lines.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="403" data-original-width="403" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSSi6T2phz-4aUuUW53I6XGOQR-JWTrFrZB8F46Ugw6LQQvW_F4ixML1CksCBZwveJfz6A4rlk0DEXuueT86L26WISio538_5zepwhL4PPVS4lv1WSbotigy3jJVRIxUegLCBursLCtpk/s320/Parallel+Lines.png" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
<div>
<div>
To complete the box, we have to draw the vertical lines. The coordinates of the left vertical line is (-125, -105) and its length is 350.</div>
<div>
<br /></div>
<div>
The code to do this is shown below:</div>
<div>
<br /></div>
<div>
turtle.penup()</div>
<div>
turtle.setheading(90)</div>
<div>
turtle.setposition(-125, -105)</div>
<div>
turtle.pendown()</div>
<div>
turtle.forward(210)</div>
<div>
<br /></div>
</div>
<div>
<div>
The code to draw the other vertical line is shown below:</div>
<div>
<br /></div>
<div>
turtle.penup()</div>
<div>
turtle.setheading(90)</div>
<div>
turtle.setposition(125, -105)</div>
<div>
turtle.pendown()</div>
<div>
turtle.forward(210)</div>
<div>
<br /></div>
<div>
The generated image is shown below:</div>
</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBNHiaHD4Xe2arTaRrCaNdBYrhFp6AgGOzYjvlAvsfPAXCCByhM5GumZOaP0MZbTU5QbX1_9QbjGfshOKIBC4gYTlhCr8xdRJGTtwsjHUJH19mhnCVVEBIZRCAT36G6ak2t_8hYJ6SI1A/s1600/Vertical+Lines.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="403" data-original-width="403" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBNHiaHD4Xe2arTaRrCaNdBYrhFp6AgGOzYjvlAvsfPAXCCByhM5GumZOaP0MZbTU5QbX1_9QbjGfshOKIBC4gYTlhCr8xdRJGTtwsjHUJH19mhnCVVEBIZRCAT36G6ak2t_8hYJ6SI1A/s320/Vertical+Lines.png" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
<div>
<div>
Drawing the diagonals is easy but we need to find the length of the diagonal and its angle.</div>
<div>
<br /></div>
<div>
Our first task is to find the angle between two points (-125, -105) and (125, 105). We will use the coordinateDistance function. The code for this is shown below:</div>
<div>
<br /></div>
<div>
def coordinateDistance(x1, y1, x2, y2):</div>
<div>
dx = x1 - x2</div>
<div>
dy = y1 - y2</div>
<div>
D = math.sqrt((dx * dx) + (dy * dy))</div>
<div>
return D</div>
<div>
<span style="white-space: pre;"> </span></div>
<div>
We call the function using the code shown below:</div>
<div>
<br /></div>
<div>
diagonalLength = coordinateDistance(-125, -105, 125, 105)</div>
<div>
<br /></div>
<div>
The code to find the angle between the point is shown below:</div>
<div>
<br /></div>
</div>
<div>
<div>
myradians = math.atan2(105 - (-105), 125 - (-125))</div>
<div>
angle = math.degrees(myradians)</div>
<div>
<br /></div>
<div>
We move the turtle to the position (-125, -105) and draw the line. The code to do this is shown below:</div>
<div>
<br /></div>
<div>
turtle.penup()</div>
<div>
turtle.setposition(-125, -105)</div>
<div>
turtle.setheading(angle)</div>
<div>
turtle.pendown()</div>
<div>
turtle.forward(diagonalLength)</div>
<div>
<br /></div>
<div>
The code to draw the other diagonal is given below:</div>
<div>
<br /></div>
<div>
turtle.penup()</div>
<div>
turtle.setposition(125, -105)</div>
<div>
turtle.setheading(180 - angle)</div>
<div>
turtle.pendown()</div>
<div>
turtle.forward(diagonalLength)</div>
<div>
<br /></div>
<div>
The generated image is shown below:</div>
</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFEe5qbKJC5Poy2CU0ZA4i4ZN-RWqHQmBJiMNR3Y_1h_glmNTUVv3pzv08JLRzv-h4uAkjVCgmY2aej1DaJAsMY7Ch9HK0MpaA0Z5r8p432TWVAnX6dwUeNXLPxP2dXH2qUciknUJfpn0/s1600/Diagonals.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="403" data-original-width="403" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFEe5qbKJC5Poy2CU0ZA4i4ZN-RWqHQmBJiMNR3Y_1h_glmNTUVv3pzv08JLRzv-h4uAkjVCgmY2aej1DaJAsMY7Ch9HK0MpaA0Z5r8p432TWVAnX6dwUeNXLPxP2dXH2qUciknUJfpn0/s320/Diagonals.png" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
<div>
<div>
Drawing the serrated lines is easy. We simply need to move the turtle to that position and draw the lines.</div>
<div>
<br /></div>
<div>
The coordinate of the first line is (-175, 105) and it length is 50 pixels. The code to draw it is shown below:</div>
<div>
<br /></div>
<div>
turtle.penup()</div>
<div>
turtle.setposition(-175, 105)</div>
<div>
turtle.setheading(90)</div>
<div>
turtle.pendown()</div>
<div>
turtle.forward(50)</div>
<div>
<br /></div>
<div>
To draw the rest, we move the the pen by 50 pixels. The code to do this is shown below:</div>
<div>
<br /></div>
<div>
turtle.penup()</div>
<div>
turtle.setposition(-125, 105)</div>
<div>
turtle.setheading(90)</div>
<div>
turtle.pendown()</div>
<div>
turtle.forward(50)</div>
<div>
<br /></div>
<div>
The rest of the code for the upper part is shown below:</div>
<div>
<br /></div>
<div>
turtle.penup()</div>
<div>
turtle.setposition(-75, 105)</div>
<div>
turtle.setheading(90)</div>
<div>
turtle.pendown()</div>
<div>
turtle.forward(50)</div>
<div>
<br /></div>
<div>
turtle.penup()</div>
<div>
turtle.setposition(-25, 105)</div>
<div>
turtle.setheading(90)</div>
<div>
turtle.pendown()</div>
<div>
turtle.forward(50)</div>
<div>
<br /></div>
<div>
turtle.penup()</div>
<div>
turtle.setposition(25, 105)</div>
<div>
turtle.setheading(90)</div>
<div>
turtle.pendown()</div>
<div>
turtle.forward(50)</div>
<div>
<br /></div>
<div>
turtle.penup()</div>
<div>
turtle.setposition(75, 105)</div>
<div>
turtle.setheading(90)</div>
<div>
turtle.pendown()</div>
<div>
turtle.forward(50)</div>
<div>
<br /></div>
<div>
turtle.penup()</div>
<div>
turtle.setposition(125, 105)</div>
<div>
turtle.setheading(90)</div>
<div>
turtle.pendown()</div>
<div>
turtle.forward(50)</div>
<div>
<br /></div>
<div>
turtle.penup()</div>
<div>
turtle.setposition(175, 105)</div>
<div>
turtle.setheading(90)</div>
<div>
turtle.pendown()</div>
<div>
turtle.forward(50)</div>
<div>
<br /></div>
<div>
The generated image is shown below:</div>
<div>
<br /></div>
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjvKHG274mg4DqBkHEF9ohickBFAUkb4rF_B_tNPoIqW40pM8yIYcmsHpCaT1cQ3FN1OcVeeWDJWrBdbSv_VPtwAZXO_k1SRHCekRwDHFaEPwAkdT8BLegMDMAG6iNL-EQ1MoZltNTmhj0/s1600/Upper+Serrated+Edge.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="403" data-original-width="403" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjvKHG274mg4DqBkHEF9ohickBFAUkb4rF_B_tNPoIqW40pM8yIYcmsHpCaT1cQ3FN1OcVeeWDJWrBdbSv_VPtwAZXO_k1SRHCekRwDHFaEPwAkdT8BLegMDMAG6iNL-EQ1MoZltNTmhj0/s320/Upper+Serrated+Edge.png" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
To draw the lower part, we simply invert the coordinates of the y axis for the shape and change the heading of the turtle to 270.<br />
<br />
The code to do this is shown below:<br />
<br />
turtle.penup()<br />
turtle.setposition(-175, -105)<br />
turtle.setheading(270)<br />
turtle.pendown()<br />
turtle.forward(50)<br />
<br />
turtle.penup()<br />
turtle.setposition(-125, -105)<br />
turtle.setheading(270)<br />
turtle.pendown()<br />
turtle.forward(50)<br />
<br />
turtle.penup()<br />
turtle.setposition(-75, -105)<br />
turtle.setheading(270)<br />
turtle.pendown()<br />
turtle.forward(50)<br />
<br />
turtle.penup()<br />
turtle.setposition(-25, -105)<br />
turtle.setheading(270)<br />
turtle.pendown()<br />
turtle.forward(50)<br />
<br />
turtle.penup()<br />
turtle.setposition(25, -105)<br />
turtle.setheading(270)<br />
turtle.pendown()<br />
turtle.forward(50)<br />
<br />
turtle.penup()<br />
turtle.setposition(75, -105)<br />
turtle.setheading(270)<br />
turtle.pendown()<br />
turtle.forward(50)<br />
<br />
turtle.penup()<br />
turtle.setposition(125, -105)<br />
turtle.setheading(270)<br />
turtle.pendown()<br />
turtle.forward(50)<br />
<br />
turtle.penup()<br />
turtle.setposition(175, -105)<br />
turtle.setheading(270)<br />
turtle.pendown()<br />
turtle.forward(50)<br />
<br />
The generated image is shown below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5Aw1IsLTHWUIf079SXOkbqYo4LAc2R31Qpp2mFGQsysEFBcy679z6jlZx7LgcuTRNNRCHPeoeyVfgMpfkMCQFA1og8CP5M5ZhlT7X1DRFwA-SGaTJPhEEXnk7g9VJtNHzbOsyKbhKSf8/s1600/Lower+Serrated+Edge.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="403" data-original-width="403" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5Aw1IsLTHWUIf079SXOkbqYo4LAc2R31Qpp2mFGQsysEFBcy679z6jlZx7LgcuTRNNRCHPeoeyVfgMpfkMCQFA1og8CP5M5ZhlT7X1DRFwA-SGaTJPhEEXnk7g9VJtNHzbOsyKbhKSf8/s320/Lower+Serrated+Edge.png" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
To draw the left serrated edge, we will first draw the one at the center then figure out how to draw the rest.<br />
<br />
The coordinates of the center are (-125, 0). We set its heading to 180 degrees and move forward by 50 pixels.<br />
<br />
The code to do this is shown below:<br />
<br />
turtle.penup()<br />
turtle.setposition(-125, 0)<br />
turtle.setheading(180)<br />
turtle.pendown()<br />
turtle.forward(50)<br />
<br />
The generated image is shown below:<br />
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDofCwCaaQrS33aSYyTtyJLUrr6mOtDxPliQvY4ZvGWh5_v8SBTbXtR1Q_Vx9qE7oJZSyCWH2GxV47AqIImae-Jhcuh9uSRSYy19IPulovwGkcx9-EZyusv3YKsNFTar0lDkc9aTJQS14/s1600/Horizontal+Center.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="403" data-original-width="403" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDofCwCaaQrS33aSYyTtyJLUrr6mOtDxPliQvY4ZvGWh5_v8SBTbXtR1Q_Vx9qE7oJZSyCWH2GxV47AqIImae-Jhcuh9uSRSYy19IPulovwGkcx9-EZyusv3YKsNFTar0lDkc9aTJQS14/s320/Horizontal+Center.png" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
<div>
<div>
By extrapolation, the y coordinates of the remaining two horizontal lines are 52.5 and -52.5. The code to draw the remaining horizontal lines is given below:</div>
<div>
<br /></div>
<div>
turtle.penup()</div>
<div>
turtle.setposition(-125, 52.5)</div>
<div>
turtle.setheading(180)</div>
<div>
turtle.pendown()</div>
<div>
turtle.forward(50)</div>
<div>
<br /></div>
<div>
turtle.penup()</div>
<div>
turtle.setposition(-125, -52.5)</div>
<div>
turtle.setheading(180)</div>
<div>
turtle.pendown()</div>
<div>
turtle.forward(50)</div>
<div>
<br /></div>
<div>
The generated image is shown below:</div>
</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhimg1bZo6DI2T2SySuqv6mzivuvi3rYp8uUhIp2ciArdo2tacsI-toxuWObITvd8pf2I1oHgSR2QvV0po2vHjw8PH2zwjZIqVPY5gosrx7JhYtQTbiDSKZwT-2Bkc7e6XswBcfYn1CVis/s1600/Left+Horizontal+Lines.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="403" data-original-width="403" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhimg1bZo6DI2T2SySuqv6mzivuvi3rYp8uUhIp2ciArdo2tacsI-toxuWObITvd8pf2I1oHgSR2QvV0po2vHjw8PH2zwjZIqVPY5gosrx7JhYtQTbiDSKZwT-2Bkc7e6XswBcfYn1CVis/s320/Left+Horizontal+Lines.png" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
<div>
<div>
Drawing the right side is easy enough. The code to do so is shown below:</div>
<div>
<br /></div>
<div>
turtle.penup()</div>
<div>
turtle.setposition(125, 0)</div>
<div>
turtle.setheading(0)</div>
<div>
turtle.pendown()</div>
<div>
turtle.forward(50)</div>
<div>
<br /></div>
<div>
turtle.penup()</div>
<div>
turtle.setposition(125, 52.5)</div>
<div>
turtle.setheading(0)</div>
<div>
turtle.pendown()</div>
<div>
turtle.forward(50)</div>
<div>
<br /></div>
<div>
turtle.penup()</div>
<div>
turtle.setposition(125, -52.5)</div>
<div>
turtle.setheading(0)</div>
<div>
turtle.pendown()</div>
<div>
turtle.forward(50)</div>
<div>
<br /></div>
<div>
The generated image is shown below:</div>
</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgeEMQGZ6s7OAhGR8bIcT4dgZNPXLh24XnpUPllz-55-o4sARntMtTbH1vkEveF6JA8R45qh_YOxiyKD6lLeGngvXFLfj15UEq_8Ogmuw3rUvxH7rk-KWta1xdLoe6Tj2s3gxVmTTNeBNw/s1600/Final+Symbol.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="403" data-original-width="403" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgeEMQGZ6s7OAhGR8bIcT4dgZNPXLh24XnpUPllz-55-o4sARntMtTbH1vkEveF6JA8R45qh_YOxiyKD6lLeGngvXFLfj15UEq_8Ogmuw3rUvxH7rk-KWta1xdLoe6Tj2s3gxVmTTNeBNw/s320/Final+Symbol.png" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
<div>
<div>
<u>Conclusion</u></div>
<div>
<br /></div>
<div>
At the end of this section, we have succeeded in drawing the Mrammuo symbol.</div>
<div>
<br /></div>
<div>
This post is part of the series: <a href="http://trustonteachestech.blogspot.com.ng/p/drawing-adinkra-symbols-using-python.html" target="_blank">Drawing Adinkra Symbols using Python</a>. The goal is to draw 40 Adinkra symbols using the Python programming language.</div>
</div>
<br />Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7654257377456795992.post-14443979321972726452018-04-19T04:50:00.003-07:002018-04-19T04:50:43.011-07:00Mpuankron<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiVu6mw1nlIuoi39nXfWLjmiJ1Od_FqzzV7_-F5VFweWWa28A63UYIWM1ZRGGF8jKF2sna_nDAjw_n17hgjrhqpdV8haISMe0PEOL1Q2JXLKmFYqvVJoyPe3D54gtYc-EMgKSpPpu54cZM/s1600/Mpuankron.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="200" data-original-width="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiVu6mw1nlIuoi39nXfWLjmiJ1Od_FqzzV7_-F5VFweWWa28A63UYIWM1ZRGGF8jKF2sna_nDAjw_n17hgjrhqpdV8haISMe0PEOL1Q2JXLKmFYqvVJoyPe3D54gtYc-EMgKSpPpu54cZM/s1600/Mpuankron.png" /></a></div>
<div style="text-align: center;">
<br /></div>
Mpuankron means "nine tufts of hair". It is the symbol of democracy.<br />
<br />
We will use the 5 pixel grid to trace out this image. The image of this is shown below:<br />
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEic37V3CKSHG_8H_0twtVTZ5YHtJXcustMOEwsUUq98OsfSWyp9j8lYT4QO4HrQW89dvlyVLoxwD1D4ggzkNUEvX20NFcrUlABdRk6IXJiiN9IqniBAf6X5BFDTM920UvaMzTEEUhdTVus/s1600/Grid.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="200" data-original-width="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEic37V3CKSHG_8H_0twtVTZ5YHtJXcustMOEwsUUq98OsfSWyp9j8lYT4QO4HrQW89dvlyVLoxwD1D4ggzkNUEvX20NFcrUlABdRk6IXJiiN9IqniBAf6X5BFDTM920UvaMzTEEUhdTVus/s1600/Grid.png" /></a></div>
<div style="text-align: center;">
<br /></div>
<div>
<div class="MsoNormal">
The plan to draw this shape is given below:</div>
<div class="MsoNormal">
</div>
<ol>
<li>Lift up the pen</li>
<li>Move the pen to the location for the upper left square</li>
<li>Draw the first square</li>
<li>Repeat steps 1 - 3 for the other squares</li>
</ol>
<br />
<div>
<u>Using Turtle Graphics</u></div>
<div>
<div>
<br /></div>
<div>
We will use the template.py file and rename it to mpuankron.py.</div>
<div>
<br /></div>
<div>
Before we can draw the first square, we need to draw two diagonals. To do this we borrow the code from Akoma Ntoaso project. We only need the diagonal length for the entire grid. This is 565.685424949.</div>
<div>
<br /></div>
<div>
The code below will draw the diagonal lines.</div>
</div>
</div>
<div>
<br /></div>
<div>
<div>
turtle.penup()</div>
<div>
turtle.setposition(-200, -200)</div>
<div>
turtle.setheading(45)</div>
<div>
turtle.pendown()</div>
<div>
turtle.forward(565.685424949)</div>
<div>
turtle.penup()</div>
<div>
turtle.setposition(200, -200)</div>
<div>
turtle.setheading(135)</div>
<div>
turtle.pendown()</div>
<div>
turtle.forward(565.685424949)</div>
</div>
<div>
<br /></div>
<div>
The generated image is shown below:</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUB7KMSWAaJrXYjBNz68WDxTl7GPi2Q1N905UDi5-S4yt3sP1ZdNif1h-WS3GfpKh7j9cghzFmJM2D_zuAUMlHs70FO4rtTbX-lZsxhJQcSg50Up1MjIKms6ZdE3KrdTQRCxVky-MSVZY/s1600/Diagonal+Centers.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="403" data-original-width="403" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUB7KMSWAaJrXYjBNz68WDxTl7GPi2Q1N905UDi5-S4yt3sP1ZdNif1h-WS3GfpKh7j9cghzFmJM2D_zuAUMlHs70FO4rtTbX-lZsxhJQcSg50Up1MjIKms6ZdE3KrdTQRCxVky-MSVZY/s320/Diagonal+Centers.png" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
<div>
<div>
The coordinates of the first square is (-175, 175). We will move the pen there and draw the square.</div>
<div>
<br /></div>
<div>
As we need to repeat the operation 9 times, we can best do it with a function. To create the function we only need the starting position of the function and the length of the square we want to draw.</div>
<div>
<br /></div>
<div>
Do bear in mind that the length of the square is 70 pixels.</div>
<div>
<br /></div>
<div>
The code for the function is shown below:</div>
<div>
<br /></div>
</div>
<div style="text-align: left;">
<div>
def drawFilledSquare(x, y, length):</div>
<div>
turtle.penup()</div>
<div>
turtle.setposition(x, y)</div>
<div>
turtle.begin_fill()</div>
<div>
turtle.setheading(0)</div>
<div>
turtle.forward(length)</div>
<div>
turtle.right(90)</div>
<div>
turtle.forward(length)</div>
<div>
turtle.right(90)</div>
<div>
turtle.forward(length)</div>
<div>
turtle.right(90)</div>
<div>
turtle.forward(length)</div>
<div>
turtle.right(90)</div>
<div>
turtle.end_fill()</div>
<div>
<span style="white-space: pre;"> </span></div>
<div>
To call the function, we simple pass in the parameters for the first square. The code for this is given below:</div>
<div>
<br /></div>
<div>
drawFilledSquare(-175, 175, 70)</div>
<div>
<br /></div>
<div>
The generated image is shown below:</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjeXRed1nsQf9r_BMjbXOkFZjBwPXvtmcdc8UWP5GZlPhFyVy9dov3pK1QRcWsn4ti2WgUG_yU6GyFv_CozwJ2BBdxY3FpPQWf8n5QZ3gj8NFhuZSnVxdkMj1Sj3NFs_UIx5zUj1-dAnZg/s1600/First+Square.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="404" data-original-width="406" height="318" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjeXRed1nsQf9r_BMjbXOkFZjBwPXvtmcdc8UWP5GZlPhFyVy9dov3pK1QRcWsn4ti2WgUG_yU6GyFv_CozwJ2BBdxY3FpPQWf8n5QZ3gj8NFhuZSnVxdkMj1Sj3NFs_UIx5zUj1-dAnZg/s320/First+Square.png" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
<div>
<div>
The coordinates for the second, third, fourth and fifth squares are (-105, 105), (-35, 35), (35, -35) and (105, -105). The code to call the function is given below:</div>
<div>
<br /></div>
<div>
drawFilledSquare(-105, 105, 70)</div>
<div>
drawFilledSquare(-35, 35, 70)</div>
<div>
drawFilledSquare(35, -35, 70)</div>
<div>
drawFilledSquare(105, -105, 70)</div>
<div>
<br /></div>
<div>
The generated image is shown below:</div>
<div>
<br /></div>
</div>
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnign0e1ONGqUjJ7xy1Q9iKztXZsPUTc0P9rIXva1XAUvm1XAsegYKUEnpZSVZN7qe3tl5vbOe2BfzX8s55_7Nldsbfmy13AU-QdQOAlVxFu_wa_vT7iDlc8BpXFwGmr4Xorz5gAbyjRY/s1600/Five+Squares.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="403" data-original-width="403" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnign0e1ONGqUjJ7xy1Q9iKztXZsPUTc0P9rIXva1XAUvm1XAsegYKUEnpZSVZN7qe3tl5vbOe2BfzX8s55_7Nldsbfmy13AU-QdQOAlVxFu_wa_vT7iDlc8BpXFwGmr4Xorz5gAbyjRY/s320/Five+Squares.png" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
<div>
<div>
To complete the symbol, we need the coordinates for the remaining squares. Starting from the lower left hand side, the coordinates are: (-175, -105), (-105, -35), (35, 105) and (105, 175).</div>
<div>
<br /></div>
<div>
The code to call the function is shown below:</div>
<div>
<br /></div>
<div>
drawFilledSquare(-175, -105, 70)</div>
<div>
drawFilledSquare(-105, -35, 70)</div>
<div>
drawFilledSquare(35, 105, 70)</div>
<div>
drawFilledSquare(105, 175, 70)</div>
<div>
<br /></div>
<div>
The generated image is shown below:</div>
<div>
<br /></div>
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFD2ZeT8m_Uzg2agWqh1d0UQvMXXqMStTVSVIlbhA9TQXDGYwyi1uqMhyV9PIpPVEgcdfz4lEsiP9xl2DZLrMYXn8yptyjnrJNK0_fT2wIvldt2htrbwTqBRvKkQeVRuB1BfH8Qlk0uzs/s1600/Final+Symbol.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="403" data-original-width="403" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFD2ZeT8m_Uzg2agWqh1d0UQvMXXqMStTVSVIlbhA9TQXDGYwyi1uqMhyV9PIpPVEgcdfz4lEsiP9xl2DZLrMYXn8yptyjnrJNK0_fT2wIvldt2htrbwTqBRvKkQeVRuB1BfH8Qlk0uzs/s320/Final+Symbol.png" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
<div>
<div>
<u>Conclusion</u></div>
<div>
<br /></div>
<div>
At the end of this section we have succeeded in drawing the Mpuankron symbol. You have to admit that it has a particular eerie beauty to it.</div>
<div>
<br /></div>
<div>
This post is part of the series: <a href="http://trustonteachestech.blogspot.com.ng/p/drawing-adinkra-symbols-using-python.html" target="_blank">Drawing Adinkra Symbols using Python</a>. The goal is to draw 40 Adinkra symbols using the Python programming language.</div>
</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7654257377456795992.post-73656632468201917262018-04-10T11:42:00.003-07:002018-04-10T11:42:47.074-07:00Mmara Krado<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbffBGeaiPmkzRcZ5QSqAN5Z3-psNAVYg4ugc8hvGjTK8mFdj-2HXhRyKmpqeC6uzGwZiGM23-6IobLBtdCKNdCjbDcUhyIoZoKwLtXTa4n7wpqoPcgmX6BlF8F6Jef8WNb9vnhOhIfaA/s1600/Mmara+Krado.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="200" data-original-width="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbffBGeaiPmkzRcZ5QSqAN5Z3-psNAVYg4ugc8hvGjTK8mFdj-2HXhRyKmpqeC6uzGwZiGM23-6IobLBtdCKNdCjbDcUhyIoZoKwLtXTa4n7wpqoPcgmX6BlF8F6Jef8WNb9vnhOhIfaA/s1600/Mmara+Krado.png" /></a></div>
<div style="text-align: center;">
<br /></div>
Mmara Krado is composed of two distinct words. "Mmara" means law and "Krado" means padlock. It is the symbol of the seal of law and order. It represents supreme authority and the court of justice.<br />
<br />
We will use the 5 pixel grid to trace out this image. The image of this is shown below:<br />
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiaKRnTY1DqISDLSOmJmKQf94tATs5uU2IsPtejoKV3pbwtbeDWHmr_g9wovngvbEnXWSV0b_WM92dkSrqgWvD4z5vtEESlRgevL5CMXjOUSm2oqTDGsXcGHc5GN3gB-HYOv2C8rWmEXec/s1600/Grid.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="200" data-original-width="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiaKRnTY1DqISDLSOmJmKQf94tATs5uU2IsPtejoKV3pbwtbeDWHmr_g9wovngvbEnXWSV0b_WM92dkSrqgWvD4z5vtEESlRgevL5CMXjOUSm2oqTDGsXcGHc5GN3gB-HYOv2C8rWmEXec/s1600/Grid.png" /></a></div>
<div style="text-align: center;">
<br /></div>
<div>
<div class="MsoNormal">
<span style="font-size: 12pt;">The plan to draw this shape is given below:</span><span style="font-size: 12pt;"><o:p></o:p></span></div>
<div class="MsoNormal">
</div>
<ol>
<li>Lift up the pen</li>
<li>Set the pensize to 15 pixels</li>
<li>Move the turtle to the left position of the inner semi-circle of the upper part of the symbol</li>
<li>Set the heading to 90 degrees</li>
<li>Place the pen down</li>
<li>Draw the inner semi-circle</li>
<li>Lift up the pen</li>
<li>Move the turtle to the left position of the middle semi-circle of the upper part of the symbol</li>
<li>Set the heading to 90 degrees</li>
<li>Place the pen down</li>
<li>Draw the middle semi-circle</li>
<li>Lift up the pen</li>
<li>Move the turtle to the left position of the outer semi-circle of the upper part of the symbol</li>
<li>Set the heading to 90 degrees</li>
<li>Place the pen down</li>
<li>Draw the outer semi-circle</li>
<li>Lift up the pen</li>
<li>Move the turtle to the right position of the inner semi-circle of the lower part of the symbol</li>
<li>Set the heading to 270 degrees</li>
<li>Place the pen down</li>
<li>Draw the inner semi-circle</li>
<li>Lift up the pen</li>
<li>Move the turtle to the right position of the middle semi-circle of the lower part of the symbol</li>
<li>Set the heading to 270 degrees</li>
<li>Place the pen down</li>
<li>Draw the middle semi-circle</li>
<li>Lift up the pen</li>
<li>Move the turtle to the right position of the outer semi-circle of the lower part of the symbol</li>
<li>Set the heading to 270 degrees</li>
<li>Place the pen down</li>
<li>Draw the outer semi-circle</li>
<li>Lift up the pen</li>
<li>Place the pen at the location for the leftmost part of the upper part of the symbol</li>
<li>Set the heading to 0 degrees</li>
<li>Place the pen down</li>
<li>Move forward to cover the leftmost part of the upper part of the symbol</li>
<li>Lift up the pen</li>
<li>Move the pen to the location of the innermost part of the upper part of the symbol</li>
<li>Place the pen down</li>
<li>Move forward to cover the right of the upper part of the symbol</li>
<li>Lift up the pen</li>
<li>Place the pen at the location for the leftmost part of the lower part of the symbol</li>
<li>Place the pen down</li>
<li>Move forward to cover the leftmost part of the lower part of the symbol</li>
<li>Lift up the pen</li>
<li>Move forward over the gap between the two parts</li>
<li>Place the pen down</li>
<li>Move forward to cover the right of the lower part of the symbol</li>
<li>Lift up the pen</li>
<li>Move the pen to the left location of the middle semi-circle</li>
<li>Set the heading to 90 degrees</li>
<li>Move forward to cover the gap</li>
<li>Lift up the pen</li>
<li>Move the pen to the right location of the middle semi-circle</li>
<li>Move forward to cover the gap</li>
</ol>
<div>
<div>
<u>Using Turtle Graphics</u></div>
<div>
<br /></div>
<div>
We will use the template.py file and rename it to mmara.py.</div>
<div>
<br /></div>
<div>
The coordinate left position of the inner semi-circle is (25, 50). Once we know this, we can write the code for steps 1 to 6.</div>
</div>
<div>
<br /></div>
<div>
<div>
The code for this is shown below:</div>
<div>
<br /></div>
<div>
turtle.penup()</div>
<div>
turtle.pensize(30)</div>
<div>
turtle.setposition(25, 50)</div>
<div>
turtle.setheading(90)</div>
<div>
turtle.pendown()</div>
<div>
turtle.circle(25, 180)</div>
<div>
<br /></div>
<div>
The generated image is shown below:</div>
</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1grwKpdk-gepR2x10z0ozkjCMc7DiElU6FaUiyRCY2lDJNh9xVwdy-B2d3fEPcV7WqXWqbGcGv9-jCOOsVAtWVXUOJhTsApUOj4gRTiFve1-g20mgN9Q0spFYM02JOrYYtgjZMFfdotY/s1600/Upper+Inner+Circle.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="405" data-original-width="405" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1grwKpdk-gepR2x10z0ozkjCMc7DiElU6FaUiyRCY2lDJNh9xVwdy-B2d3fEPcV7WqXWqbGcGv9-jCOOsVAtWVXUOJhTsApUOj4gRTiFve1-g20mgN9Q0spFYM02JOrYYtgjZMFfdotY/s320/Upper+Inner+Circle.png" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
<div>
<div>
The coordinate of the middle semi-circle is (75, 50). Knowing this value, we can draw the middle semi-circle. The code for steps 7 to 11 is shown below:</div>
<div>
<br /></div>
<div>
turtle.penup()</div>
<div>
turtle.setposition(75, 50)</div>
<div>
turtle.setheading(90)</div>
<div>
turtle.pendown()</div>
<div>
turtle.circle(75, 180)</div>
<div>
<br /></div>
<div>
The generated image is shown below:</div>
<div>
<br /></div>
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPTIu4Gu8Eq8QR1h7_8FdqzcbER2vxhZDm8Ub7XZiZdIOInq1KKZFF51Dt66yAUzcJNxJFbZ3yWFpKXEMnHOiqRNrTFwqjriJ14iKZbwuSKzU7o_ivDp_A8EtEL7XOHw7DuNgifqciAJE/s1600/Upper+Middle+Circle.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="405" data-original-width="405" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPTIu4Gu8Eq8QR1h7_8FdqzcbER2vxhZDm8Ub7XZiZdIOInq1KKZFF51Dt66yAUzcJNxJFbZ3yWFpKXEMnHOiqRNrTFwqjriJ14iKZbwuSKzU7o_ivDp_A8EtEL7XOHw7DuNgifqciAJE/s320/Upper+Middle+Circle.png" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
</div>
The coordinate of the outer semi-circle is (125, 50). Knowing this value, we can draw the outer semi-circle. The code for steps 12 to 16 is shown below:<br />
<br />
turtle.penup()<br />
turtle.setposition(125, 50)<br />
turtle.setheading(90)<br />
turtle.pendown()<br />
turtle.circle(125, 180)<br />
<br />
The generated image is shown below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkSN9eAAEMMTULADLLpfvjFCoNf6_SbfFx19fALnppdlGwMG15dVF8gDuZfMscIi_7PLphEvtnNisANEOZV_3vuT0ubkgbbJ9JpIE5CohOpq7CAaCYjwhwSfhQYYPdi3KCdVBHouswQSA/s1600/Upper+Outer+Circle.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="405" data-original-width="405" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkSN9eAAEMMTULADLLpfvjFCoNf6_SbfFx19fALnppdlGwMG15dVF8gDuZfMscIi_7PLphEvtnNisANEOZV_3vuT0ubkgbbJ9JpIE5CohOpq7CAaCYjwhwSfhQYYPdi3KCdVBHouswQSA/s320/Upper+Outer+Circle.png" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
The coordinate for the inner semi-circle of the lower part of the symbol is (-25, -50). The code for steps 17 to 21 is given below:<br />
<br />
turtle.penup()<br />
turtle.setposition(-25, -50)<br />
turtle.setheading(270)<br />
turtle.pendown()<br />
turtle.circle(25, 180)<br />
<br />
The generated image is shown below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtGXZzn1kv0A8HZkq-oRjGYRQsEta_ne-3-OJ_tZWTqrTEV-PvQz0zgHgKGrsToF5MCDmbo6SJWJ5x3MOF22Iu-YuIqa2BrDRs1ducsEf5UFm-5IfqZYvahflRoq1CzNbKsefcQY6bM28/s1600/Lower+Inner+Circle.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="405" data-original-width="405" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtGXZzn1kv0A8HZkq-oRjGYRQsEta_ne-3-OJ_tZWTqrTEV-PvQz0zgHgKGrsToF5MCDmbo6SJWJ5x3MOF22Iu-YuIqa2BrDRs1ducsEf5UFm-5IfqZYvahflRoq1CzNbKsefcQY6bM28/s320/Lower+Inner+Circle.png" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
The coordinate for the middle semi-circle of the lower part of the symbol is is (-75, -50). The code for steps 22 to 26 is given below:<br />
<br />
turtle.penup()<br />
turtle.setposition(-75, -50)<br />
turtle.setheading(270)<br />
turtle.pendown()<br />
turtle.circle(75, 180)<br />
<br />
The generated image is shown below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFG1uNU2nsZQZC776y1Mptqi05PDExNS4_myOXTP75nUCPFRBcNTnWYIfQl_PBczha1Jw6heJb9OPaiEGDI3WDWYDCLGUPKGrve_Bl61nshdap1I1-qKs_i4EAT-CCxFsHlqZYSJHctX4/s1600/Lower+Middle+Circle.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="405" data-original-width="405" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFG1uNU2nsZQZC776y1Mptqi05PDExNS4_myOXTP75nUCPFRBcNTnWYIfQl_PBczha1Jw6heJb9OPaiEGDI3WDWYDCLGUPKGrve_Bl61nshdap1I1-qKs_i4EAT-CCxFsHlqZYSJHctX4/s320/Lower+Middle+Circle.png" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
The coordinate for the middle semi-circle of the lower part of the symbol is is (-125, -50). The code for steps 27 to 31 is shown:<br />
<br />
turtle.penup()<br />
turtle.setposition(-125, -50)<br />
turtle.setheading(270)<br />
turtle.pendown()<br />
turtle.circle(125, 180)<br />
<br />
The generated image is shown below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjSw0MDYVYFa2TZsqxl139__q3EzJgzbEHtyMcBzwVuQj2skyEtMKa_f9Pk1L8yw6dvrrAyogRd7I_W_4y_lW0cxSKyLgGeM5vB1lIoF3QA34k0O_HbrT7txNH5l_ymFIx0VVmKz7D3OL8/s1600/Lower+Outer+Circle.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="403" data-original-width="403" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjSw0MDYVYFa2TZsqxl139__q3EzJgzbEHtyMcBzwVuQj2skyEtMKa_f9Pk1L8yw6dvrrAyogRd7I_W_4y_lW0cxSKyLgGeM5vB1lIoF3QA34k0O_HbrT7txNH5l_ymFIx0VVmKz7D3OL8/s320/Lower+Outer+Circle.png" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
The location of the leftmost part of the upper part of the symbol is (-125, 40). The distance between this point and the location of the innermost part of the upper part of the symbol is 100.<br />
<br />
The code for steps 32 to 36 is shown below:<br />
<br />
turtle.penup()<br />
turtle.setposition(-125, 40)<br />
turtle.setheading(0)<br />
turtle.pendown()<br />
turtle.forward(100)<br />
<br />
The location of the innermost part of the upper part of the symbol is at (25, 40). The code for steps 37 to 40 is shown below:<br />
<br />
turtle.penup()<br />
turtle.setposition(25, 40)<br />
turtle.pendown()<br />
turtle.forward(100)<br />
<br />
The generated image is shown below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUtzuVYOmFjAorOtTo6PslVOmg2JHksVQkj2KnZM8VzwAVDGwLgwkzG1ZdyYU4N6npB_MgbvHb1EwjvpiFzRBsJG4U5Y1ZXe3ISqiCsKIjmlYbT1YnsNe6t1hnYNQBa7tueTQIKp3XnlY/s1600/Upper+Line.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="404" data-original-width="404" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUtzuVYOmFjAorOtTo6PslVOmg2JHksVQkj2KnZM8VzwAVDGwLgwkzG1ZdyYU4N6npB_MgbvHb1EwjvpiFzRBsJG4U5Y1ZXe3ISqiCsKIjmlYbT1YnsNe6t1hnYNQBa7tueTQIKp3XnlY/s320/Upper+Line.png" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
To draw the lower line, we simply repeat the steps we used to draw the upper line but now use the coordinates (-125, -40) and (25, -40).<br />
<br />
The code to draw the lower line is shown below:<br />
<br />
turtle.penup()<br />
turtle.setposition(-125, -40)<br />
turtle.setheading(0)<br />
turtle.pendown()<br />
turtle.forward(100)<br />
turtle.penup()<br />
turtle.setposition(25, -40)<br />
turtle.pendown()<br />
turtle.forward(100)<br />
<br />
The generated image is shown below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8sXifsHd_e4prcftfed4UoE66qdsRMAP8Zqb7scCRQI-25bePpwW3HryCoGJeWaBxDS0NCCcbsnu4SayJTOSvqiLjqvIHl2AMfuzk83TIi5LqrzCN3RZE4okTRK2RAGEog5Lt8f49YL8/s1600/Lower+Line.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="401" data-original-width="399" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8sXifsHd_e4prcftfed4UoE66qdsRMAP8Zqb7scCRQI-25bePpwW3HryCoGJeWaBxDS0NCCcbsnu4SayJTOSvqiLjqvIHl2AMfuzk83TIi5LqrzCN3RZE4okTRK2RAGEog5Lt8f49YL8/s320/Lower+Line.png" width="318" /></a></div>
<div style="text-align: center;">
<br /></div>
To draw the remaining lines we only need the coordinates of the left and right location of the middle semi-circle. These are (-75, -40) and (75, -40). The gap between the two lines is 80 pixels.<br />
<br />
The code to complete the shape is shown below:<br />
<br />
turtle.penup()<br />
turtle.setposition(-75, -40)<br />
turtle.setheading(90)<br />
turtle.pendown()<br />
turtle.forward(80)<br />
<br />
turtle.penup()<br />
turtle.setposition(75, -40)<br />
turtle.setheading(90)<br />
turtle.pendown()<br />
turtle.forward(80)<br />
<br />
The final symbol is shown below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJEXDmWb311jevVEA3jhEeau605N8StrpMmB_HI6lG9wKOi4U1WSnXE5cj5L0qEkB1FLjn8Pe5WU35kB_muqQFJnkaWLClsOTlESo5s4KbxAX7GrhMKDkb7bID8AK-JDycEnB5GHACb7c/s1600/Final+Symbol.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="404" data-original-width="404" height="319" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJEXDmWb311jevVEA3jhEeau605N8StrpMmB_HI6lG9wKOi4U1WSnXE5cj5L0qEkB1FLjn8Pe5WU35kB_muqQFJnkaWLClsOTlESo5s4KbxAX7GrhMKDkb7bID8AK-JDycEnB5GHACb7c/s320/Final+Symbol.png" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
Conclusion<br />
<br />
At the end of this section, we have managed to draw the Mmara Krado symbol.<br />
<br />
This post is part of the series: <a href="http://trustonteachestech.blogspot.com.ng/p/drawing-adinkra-symbols-using-python.html" target="_blank">Drawing Adinkra Symbols using Python</a>. The goal is to draw 40 Adinkra symbols using the Python programming language.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7654257377456795992.post-69355483557702817602018-04-08T21:46:00.000-07:002018-04-08T21:46:39.971-07:00Menso Wo Kenten<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigcYPL5veZq0aIS6AtDHSwgT1KaD0KECmNqpRGdkNbZ5ucrPt07lsVW5iWVAx-jXSMU9RT3NHomukYoqjfRDJvMO8d3z3ILLurFzZDxg6LZfG2bIzcUr1cl4buvcqxWnu0auHDT2IQLbE/s1600/Menso+Wo+Kenten.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="200" data-original-width="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigcYPL5veZq0aIS6AtDHSwgT1KaD0KECmNqpRGdkNbZ5ucrPt07lsVW5iWVAx-jXSMU9RT3NHomukYoqjfRDJvMO8d3z3ILLurFzZDxg6LZfG2bIzcUr1cl4buvcqxWnu0auHDT2IQLbE/s1600/Menso+Wo+Kenten.png" /></a></div>
<div style="text-align: center;">
<br /></div>
Menso Wo Kenten means "I am not carrying your basket". It is the symbol of industry, self-reliance, and economic self-determination.<br />
<br />
We will use the 5 pixel grid to trace out this image. The image of this is shown below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjb52S8NDhhECpJJlCo5wGh0SR155kaqKD23qdIPndgGgAQNR2Z-kHGe8CKgVlgZp0maD02ystlC7zmX49bERaBz0iv_SbY4jBsePx207FfWG9sjIWOf7xtYvCGzYXzLyO-QjCwmgWe-h4/s1600/Grid.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="200" data-original-width="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjb52S8NDhhECpJJlCo5wGh0SR155kaqKD23qdIPndgGgAQNR2Z-kHGe8CKgVlgZp0maD02ystlC7zmX49bERaBz0iv_SbY4jBsePx207FfWG9sjIWOf7xtYvCGzYXzLyO-QjCwmgWe-h4/s1600/Grid.png" /></a></div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: left;">
The plan to draw this shape is given below:</div>
<div style="text-align: left;">
</div>
<ol>
<li>Get the coordinates of the starting points of the stars</li>
<li>Lift up the pen</li>
<li>Set the pen size to 10 pixels</li>
<li>Move it to the starting point of the first star</li>
<li>Place the pen down</li>
<li>Move forward by the y coordinate of the star</li>
<li>Find the angle between the turtle and the topmost part of the star</li>
<li>Set the heading of the pen to angle</li>
<li>Find the distance between the turtle and the topmost part of the star</li>
<li>Move forward by the distance found</li>
<li>Set the heading of the pen to the value of the 360 minus the angle</li>
<li>Move forward by the distance found</li>
<li>Set the heading of the pen to 0 degrees</li>
<li>Move forward by the y coordinate of the star</li>
<li>Find the angle between the turtle and the next position of the line</li>
<li>Find the distance between the turtle and the line</li>
<li>Set the heading of the pen to angle obtained in 15</li>
<li>Move forward by distance obtained in 16</li>
<li>Set the heading of the pen to value of 180 minus the value obtained in 15</li>
<li>Move forward by the distance obtained in 16</li>
<li>Set the heading of the pen to 180</li>
<li>Move forward by the y coordinate of the star </li>
<li>Set the heading of the pen to value of the angle obtained in 7 minus 180 degrees</li>
<li>Move forward by the distance obtained in 9</li>
<li>Set the heading of the pen to the value of 180 minus the angle obtained in 7</li>
<li>Move forward by the distance obtained in 9</li>
<li>Set the heading of the pen to 180 degrees</li>
<li>Move forward by the y coordinate of the first star</li>
<li>Set the heading of the pen to 300 minus the value obtained in 15</li>
<li>Move forward by the value obtained in 16</li>
<li>Set the heading of the pen to 360 minus the value obtained in 15</li>
<li>Move forward by the value obtained in 16</li>
<li>Repeat steps 4 to 32 for the second star</li>
<li>Repeat steps 4 to 32 for the third star</li>
</ol>
<br />
<div>
<u>Using Turtle Graphics</u></div>
<div>
<div>
<br /></div>
<div>
We will use the template.py file and rename it to menso.py.</div>
<div>
<br /></div>
<div>
The first step of our plan is manual. We need to find the coordinates of the starting points of the stars.</div>
</div>
<div>
<br /></div>
<div>
<div>
Starting from the smallest, these are: (-50, 40), (-100, 70) and (-150, 100). The shape we used is slightly off by 10 pixels.</div>
<div>
<br /></div>
<div>
One of the rules of design for Adinkra symbols is symmetry. As a result of this, we will shift the starting points down by 10 pixels.</div>
<div>
<br /></div>
<div>
The new coordinates are now: (-50, 30), (-100, 60) and (-150, 90). Visual inspection of the new coordinates reveal a pattern.</div>
<div>
The code for steps 2 to 6 is given below:</div>
<div>
<br /></div>
<div>
turtle.penup()</div>
<div>
turtle.setposition(-50, 30)</div>
<div>
turtle.pensize(10)</div>
<div>
turtle.pendown()</div>
<div>
turtle.forward(30)</div>
</div>
<div>
<br /></div>
<div>
<div>
Next we try to find the angle from the current position of the turtle to the topmost position of the star. The coordinates of the two positions are (-20, 30) and (0, 60). The code to do this is shown below:</div>
<div>
<br /></div>
<div>
myradians = math.atan2(60 - 30, 0 - (-20))</div>
<div>
upperAngle = math.degrees(myradians)</div>
<div>
turtle.setheading(upperAngle)</div>
<div>
<br /></div>
<div>
Next we find the distance between the two points using the coordinateDistance function shown below:</div>
<div>
<br /></div>
<div>
def coordinateDistance(x1, y1, x2, y2):</div>
<div>
dx = x1 - x2</div>
<div>
dy = y1 - y2</div>
<div>
D = math.sqrt((dx * dx) + (dy * dy))</div>
<div>
return D</div>
<div>
<span style="white-space: pre;"> </span></div>
<div>
length = coordinateDistance(-20, 30, 0, 60)</div>
<div>
turtle.forward(length)</div>
</div>
<div>
<br /></div>
<div>
<div>
Steps 11 and 12 are easy as we have the values we need the code for these steps is shown below:</div>
<div>
<br /></div>
<div>
turtle.setheading(360 - upperAngle)</div>
<div>
turtle.forward(length)</div>
<div>
<br /></div>
<div>
The code for steps 13 and 14 is given below:</div>
</div>
<div>
<br /></div>
<div>
<div>
turtle.setheading(0)</div>
<div>
turtle.forward(30)</div>
<div>
<br /></div>
<div>
The code for step 15 to 18 is shown below:</div>
<div>
<br /></div>
<div>
myradians = math.atan2(0 - 30, 30 - 50)</div>
<div>
lowerAngle = math.degrees(myradians)</div>
<div>
turtle.setheading(lowerAngle)</div>
<div>
lowerLength = coordinateDistance(50, 30, 30, 0)</div>
<div>
turtle.forward(lowerLength)</div>
<div>
<br /></div>
<div>
The code for steps 19 and 20 is given below:</div>
<div>
<br /></div>
<div>
turtle.setheading(180 - lowerAngle)</div>
<div>
turtle.forward(lowerLength)</div>
<div>
<br /></div>
<div>
From this point on, the rest is easy as we have all the values we need.</div>
<div>
<br /></div>
<div>
The code for steps 21 and 22 is given below:</div>
<div>
<br /></div>
<div>
turtle.setheading(180)</div>
<div>
turtle.forward(30)</div>
<div>
<br /></div>
<div>
The code for steps 23 and 24 is given below:</div>
<div>
<br /></div>
<div>
turtle.setheading(upperAngle - 180)</div>
<div>
turtle.forward(length)</div>
<div>
<br /></div>
<div>
The code for steps 25 and 26 is given below:</div>
<div>
<br /></div>
<div>
turtle.setheading(180 - upperAngle)</div>
<div>
turtle.forward(length)</div>
<div>
<br /></div>
<div>
The code for steps 27 and 28 is given below:</div>
<div>
<br /></div>
<div>
turtle.setheading(180)</div>
<div>
turtle.forward(30)</div>
<div>
<br /></div>
<div>
The code for steps 29 and 30 is given below:</div>
<div>
<br /></div>
<div>
turtle.setheading(300 - lowerAngle)</div>
<div>
turtle.forward(lowerLength)</div>
<div>
<br /></div>
<div>
The code for steps 31 and 32 is given below:</div>
<div>
<br /></div>
<div>
turtle.setheading(360 - lowerAngle)</div>
<div>
turtle.forward(lowerLength)</div>
<div>
<br /></div>
<div>
The generated image is shown below:</div>
</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiti9bBkYxXLPVzWVwNr65outBRucbZhHqHR02vDxYvitEJTXOBqTbSCAfE27xuBogtsLZ8ufI-EW2IvivYG1oW_b3tQNs4MmGDC-5V7IGfc7iIWHwJkvOKY1m3vy-739PCce3Utuyly6o/s1600/Inner+Star.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="401" data-original-width="402" height="319" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiti9bBkYxXLPVzWVwNr65outBRucbZhHqHR02vDxYvitEJTXOBqTbSCAfE27xuBogtsLZ8ufI-EW2IvivYG1oW_b3tQNs4MmGDC-5V7IGfc7iIWHwJkvOKY1m3vy-739PCce3Utuyly6o/s320/Inner+Star.png" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
When we decide to draw the next star we don’t need to find the angles again. All we need are the distances for the star.<br />
We repeat the code starting from step 2. We will skip the steps in the code where the value is known. The code for steps 2 to 6 is shown below:<br />
<br />
turtle.penup()<br />
turtle.setheading(0)<br />
turtle.setposition(-100, 60)<br />
turtle.pendown()<br />
turtle.forward(60)<br />
<br />
Next we find the distance from the current position of the turtle to the position of the topmost part of the star. We know the coordinate of the turtle to be (-40, 60) and that of the topmost part to be (0, 120).<br />
<br />
The code to draw the line is shown below:<br />
<br />
turtle.setheading(upperAngle)<br />
length = coordinateDistance(-40, 60, 0, 120)<br />
turtle.forward(length)<br />
<br />
The rest is easy from this point on. The code to draw the rest of the shape is shown below:<br />
<br />
turtle.setheading(360 - upperAngle)<br />
turtle.forward(length)<br />
<br />
turtle.setheading(0)<br />
turtle.forward(60)<br />
<br />
turtle.setheading(lowerAngle)<br />
turtle.forward(length)<br />
<br />
turtle.setheading(180 - lowerAngle)<br />
turtle.forward(length)<br />
<br />
turtle.setheading(180)<br />
turtle.forward(60)<br />
<br />
turtle.setheading(upperAngle - 180)<br />
turtle.forward(length)<br />
<br />
turtle.setheading(180 - upperAngle)<br />
turtle.forward(length)<br />
<br />
turtle.setheading(180)<br />
turtle.forward(60)<br />
<br />
turtle.setheading(300 - lowerAngle)<br />
turtle.forward(length)<br />
<br />
turtle.setheading(360 - lowerAngle)<br />
turtle.forward(length)<br />
<br />
The generated image is shown below:<br />
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKiaZh1ysqlSUnaMdyRSxXU6ubGfGmrMxoWVB5kp0aHF-wstAyeVg_gz6h-7WSGilohHInUBaeACslgaIR4hBtj1OyUhAJGFP-kofII8tw51BdTlv2VUXwO4ADn45EAeYcHvJCl0X5DE4/s1600/Middle+Star.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="403" data-original-width="403" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKiaZh1ysqlSUnaMdyRSxXU6ubGfGmrMxoWVB5kp0aHF-wstAyeVg_gz6h-7WSGilohHInUBaeACslgaIR4hBtj1OyUhAJGFP-kofII8tw51BdTlv2VUXwO4ADn45EAeYcHvJCl0X5DE4/s320/Middle+Star.png" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
To draw the outer star, we don’t need to do much we move the pen to is new position and find the value of the length from the position of the turtle to the topmost position.<br />
<br />
The code to do this is shown below:<br />
<br />
turtle.penup()<br />
turtle.setheading(0)<br />
turtle.setposition(-150, 90)<br />
turtle.pendown()<br />
turtle.forward(90)<br />
<br />
turtle.setheading(upperAngle)<br />
length = coordinateDistance(-60, 90, 0, 180)<br />
turtle.forward(length)<br />
<br />
turtle.setheading(360 - upperAngle)<br />
turtle.forward(length)<br />
<br />
turtle.setheading(0)<br />
turtle.forward(90)<br />
<br />
turtle.setheading(lowerAngle)<br />
turtle.forward(length)<br />
<br />
turtle.setheading(180 - lowerAngle)<br />
turtle.forward(length)<br />
<br />
turtle.setheading(180)<br />
turtle.forward(90)<br />
<br />
turtle.setheading(upperAngle - 180)<br />
turtle.forward(length)<br />
<br />
turtle.setheading(180 - upperAngle)<br />
turtle.forward(length)<br />
<br />
turtle.setheading(180)<br />
turtle.forward(90)<br />
<br />
turtle.setheading(300 - lowerAngle)<br />
turtle.forward(length)<br />
<br />
turtle.setheading(360 - lowerAngle)<br />
turtle.forward(length)<br />
<br />
The generated image is shown below:<br />
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVoe5JsGuE3HLjT_4jkNzQ0pF5RZZomj_vH1yremtrJfpMzSXkS1c_SUG8pGtGQBBIACBaZLKBsiTdFDpLH-2LzBNioQy-AaDnCXvnFCfHoLNGW-ZQj62CB65yk9ybD4ZWSHJQfhxKQq4/s1600/Outer+Star.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="405" data-original-width="406" height="319" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVoe5JsGuE3HLjT_4jkNzQ0pF5RZZomj_vH1yremtrJfpMzSXkS1c_SUG8pGtGQBBIACBaZLKBsiTdFDpLH-2LzBNioQy-AaDnCXvnFCfHoLNGW-ZQj62CB65yk9ybD4ZWSHJQfhxKQq4/s320/Outer+Star.png" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: left;">
<u>Conclusion</u></div>
<br />
At the end of this section, we have successfully drawn the shape but there is a variance on the left side.<br />
I shall address this when I review this section.<br />
<br />
In this section we cover how to draw the Menso Wo Kenten symbol. It is basically a star shaped symbol.<br />
<br />
This post is part of the series: <a href="http://trustonteachestech.blogspot.com.ng/p/drawing-adinkra-symbols-using-python.html" target="_blank">Drawing Adinkra Symbols using Python</a>. The goal is to draw 40 Adinkra symbols using the Python programming language.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7654257377456795992.post-20141327228570802752018-03-30T03:52:00.001-07:002018-03-30T03:52:41.334-07:00Kuronti ne Akwamu<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7dAx-fKvuxlJOd5aY_QbIF1pQ2MUBtNFZQg3ZYjZoTBpxp0P2OukgzHAh12G7XoyWYje9OaZff5b0g9YHXssnBhyphenhyphen0u9mtMu_ueyWeN01jObTPsZD6WEMQ1A_ZXPxnJG8Uz33kD9x7jk4/s1600/Kuronti+ne+Akwamu.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="200" data-original-width="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7dAx-fKvuxlJOd5aY_QbIF1pQ2MUBtNFZQg3ZYjZoTBpxp0P2OukgzHAh12G7XoyWYje9OaZff5b0g9YHXssnBhyphenhyphen0u9mtMu_ueyWeN01jObTPsZD6WEMQ1A_ZXPxnJG8Uz33kD9x7jk4/s1600/Kuronti+ne+Akwamu.png" /></a></div>
<div style="text-align: center;">
<br /></div>
Kuronti ne Akwamu means “Kuronti and Akwamu”. It is the symbol of democracy, sharing ideas, taking council. The Centre for Democratic Development (CDD) in Ghana holds an annual lecture series called the Kronti ne Akwamu Lecture to discuss issues related to democratic development.<br />
<br />
We will use the 5 pixel grid to trace out this image. The image of this is shown below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPf47vjrQGRvagRaXGKKwVTCHpXNltW-DvWzffnjJQWWJTWn-URXl-owoW4zQEK9GpLXd30Ty8Yyait5RuaiUl9CtFcU79XPlJhnF8c_tKhuSBDcnOJH3WTkpXQZjOOLf3y7shI9grnB4/s1600/Grid.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="200" data-original-width="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPf47vjrQGRvagRaXGKKwVTCHpXNltW-DvWzffnjJQWWJTWn-URXl-owoW4zQEK9GpLXd30Ty8Yyait5RuaiUl9CtFcU79XPlJhnF8c_tKhuSBDcnOJH3WTkpXQZjOOLf3y7shI9grnB4/s1600/Grid.png" /></a></div>
<div style="text-align: center;">
<br /></div>
The plan to draw this shape is given below:<br />
<br />
<ol>
<li>Lift up the pen</li>
<li>Set the pensize to 20 pixels</li>
<li>Draw the outer square</li>
<li>Draw the center lines</li>
<li>Set the pensize to 5 pixels</li>
<li>Draw the serrated lines in the upper left box</li>
<li>Draw the serrated lines in the lower right box</li>
</ol>
<br />
<div>
<u>Using Turtle Graphics</u></div>
<div>
<div>
<br /></div>
<div>
We will use the template.py file and rename it to kuronti.py.</div>
<div>
<br /></div>
<div>
The code for steps 1 and 2 is given below:</div>
<div>
<br /></div>
<div>
turtle.penup()</div>
<div>
turtle.pensize(20)</div>
<div>
<br /></div>
<div>
To draw the square, we need to find the length from (-180, 180) to (180, 180). This will enable us draw the square.</div>
</div>
<div>
<br /></div>
To do this, we use the coordinateDistance function which is shown below:<br />
<br />
def coordinateDistance(x1, y1, x2, y2):<br />
<span style="white-space: pre;"> </span>dx = x1 - x2<br />
<span style="white-space: pre;"> </span>dy = y1 - y2<br />
<span style="white-space: pre;"> </span>D = math.sqrt((dx * dx) + (dy * dy))<br />
<span style="white-space: pre;"> </span>return D<br />
<span style="white-space: pre;"> </span><br />
The code to find the length of the side is given below:<br />
<br />
length = coordinateDistance(-180, 180, 180, 180)<br />
<br />
The drawSquare function is now used to draw the square. The code to do this is given below:<br />
<br />
drawSquare(length)<br />
<br />
The generated image is shown below:<br />
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhO45rx8RQY_XeyxRXML53y-0oc8B-Y5JAhDSa0Siu6tJCOKQXVRENlvwYYM6UQStZstDbcnoDr6_Lo0I_02NRmowUFi1zkYTu8HfbWYIU-8kCvCoWMZNKn60vkxR7MeyHxgd841pn1Ba8/s1600/Outer+Square.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="405" data-original-width="405" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhO45rx8RQY_XeyxRXML53y-0oc8B-Y5JAhDSa0Siu6tJCOKQXVRENlvwYYM6UQStZstDbcnoDr6_Lo0I_02NRmowUFi1zkYTu8HfbWYIU-8kCvCoWMZNKn60vkxR7MeyHxgd841pn1Ba8/s320/Outer+Square.png" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
<div>
<div>
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:</div>
<div>
<br /></div>
<div>
turtle.setposition(-180, 0)</div>
<div>
turtle.pendown()</div>
<div>
turtle.forward(length)</div>
<div>
turtle.penup()</div>
<div>
turtle.setheading(90)</div>
<div>
turtle.setposition(0, -180)</div>
<div>
turtle.pendown()</div>
<div>
turtle.forward(length)</div>
<div>
<br /></div>
<div>
The generated image is shown below:</div>
</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhF9oCLdjV3MWKwYtpoC3jVK9g_H3nfGxv-AZy4ebS9OzGFk3yveRv4qJ5AhAMcmu5iE2_GoN31705jlC9vu94sJPHU-yns1WfN-fsqtCGJuxqgnM2Nt26Pna0nTwYEBxqirXEY8JQc6qQ/s1600/Center+Lines.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="406" data-original-width="406" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhF9oCLdjV3MWKwYtpoC3jVK9g_H3nfGxv-AZy4ebS9OzGFk3yveRv4qJ5AhAMcmu5iE2_GoN31705jlC9vu94sJPHU-yns1WfN-fsqtCGJuxqgnM2Nt26Pna0nTwYEBxqirXEY8JQc6qQ/s320/Center+Lines.png" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
<div>
<div>
Drawing the serrated lines is sort of tricky. This is because we have to draw them 15 times in either direction. To do this, we will use two functions. One for the horizontal lines and the other for the vertical lines.</div>
<div>
<br /></div>
<div>
The code to draw the vertical lines is given below:</div>
</div>
<div>
<br /></div>
<div>
<div>
def drawVerticalLines(x1, y1, division, space, length):</div>
<div>
<span style="white-space: pre;"> </span>for line in range(0, division):</div>
<div>
<span style="white-space: pre;"> </span>turtle.penup()</div>
<div>
<span style="white-space: pre;"> </span>turtle.setposition(x1, y1)</div>
<div>
<span style="white-space: pre;"> </span>x1 = x1 + space</div>
<div>
<span style="white-space: pre;"> </span>turtle.pendown()</div>
<div>
<span style="white-space: pre;"> </span>turtle.forward(length)</div>
<div>
<span style="white-space: pre;"> </span></div>
<div>
The code to use it is simple and straightforward. It is shown below:</div>
</div>
<div>
<br /></div>
<div>
<div>
turtle.pensize(5)</div>
<div>
length = int(length / 2)</div>
<div>
drawVerticalLines(-160, 0, 15, 10, length)</div>
<div>
<br /></div>
<div>
The generated image is shown below:</div>
</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgYcTh6-2ijFvANQ1-GgvoioZ9HYtxm_DFp7v2-ILjS_D7hd_1o3eK_aU64bmb_ERuAwSPRV-Jfada1fM0o9vUn_QM9yYc7JUeNO1Dx887sqAjSyo1ZhfAH9QyWHDiCQvCj1eXHsfgyjQY/s1600/Vetical+Upper+Box.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="403" data-original-width="403" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgYcTh6-2ijFvANQ1-GgvoioZ9HYtxm_DFp7v2-ILjS_D7hd_1o3eK_aU64bmb_ERuAwSPRV-Jfada1fM0o9vUn_QM9yYc7JUeNO1Dx887sqAjSyo1ZhfAH9QyWHDiCQvCj1eXHsfgyjQY/s320/Vetical+Upper+Box.png" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
<div>
<div>
To draw the horizontal lines on the upper left box, we create a function called drawHorizontalLines and use it. The code for drawHorizontalLines is shown below:</div>
<div>
<br /></div>
<div>
def drawHorizontalLines(x1, y1, division, space, length):</div>
<div>
<span style="white-space: pre;"> </span>for line in range(0, division):</div>
<div>
turtle.penup()</div>
<div>
turtle.setposition(x1, y1)</div>
<div>
y1 = y1 + space </div>
<div>
turtle.pendown()</div>
<div>
turtle.forward(length)</div>
<div>
<span style="white-space: pre;"> </span></div>
<div>
To draw the horizontal lines, we use the code shown below:</div>
<div>
<br /></div>
<div>
turtle.setheading(0)</div>
<div>
drawHorizontalLines(-180, 20, 15, 10, length)</div>
</div>
<div>
<br /></div>
<div>
<div align="justify" class="MsoNormal" style="margin-left: 24.0000pt; mso-char-indent-count: -2.0000; text-align: justify; text-indent: -24.0000pt; text-justify: inter-ideograph;">
<span style="font-size: 12pt;">The generated image is shown below:</span><span style="font-size: 12pt;"><o:p></o:p></span></div>
<div align="justify" class="MsoNormal" style="margin-left: 24.0000pt; mso-char-indent-count: -2.0000; text-align: justify; text-indent: -24.0000pt; text-justify: inter-ideograph;">
<span style="font-size: 12pt;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiVNkTG_EF2PWJ2GS_lBuVO-6ZqpmLeSTo0RANCPL9zIYIKA_jrDTadqCBUeEdPNKW08LoFk-pefu6KRW5QQIr7kwkdI8SnPEcROi-XZ2zkgfFyHW7dyZD4WE43IpngCrURuUMDfXFwQiA/s1600/Horizontal+Upper+Box.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="404" data-original-width="404" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiVNkTG_EF2PWJ2GS_lBuVO-6ZqpmLeSTo0RANCPL9zIYIKA_jrDTadqCBUeEdPNKW08LoFk-pefu6KRW5QQIr7kwkdI8SnPEcROi-XZ2zkgfFyHW7dyZD4WE43IpngCrURuUMDfXFwQiA/s320/Horizontal+Upper+Box.png" width="320" /></a></div>
<div class="MsoNormal" style="margin-left: 24pt; text-align: center; text-indent: -24pt;">
<span style="font-size: 12pt;"><br /></span></div>
<div align="justify" class="MsoNormal" style="margin-left: 24.0000pt; mso-char-indent-count: -2.0000; text-align: justify; text-indent: -24.0000pt; text-justify: inter-ideograph;">
To draw the serrated lines for the lower right box, we only need the starting coordinates for the horizontal</div>
<div align="justify" class="MsoNormal" style="margin-left: 24.0000pt; mso-char-indent-count: -2.0000; text-align: justify; text-indent: -24.0000pt; text-justify: inter-ideograph;">
and vertical lines which are (20, -180) and (0, -160).</div>
<div align="justify" class="MsoNormal" style="margin-left: 24.0000pt; mso-char-indent-count: -2.0000; text-align: justify; text-indent: -24.0000pt; text-justify: inter-ideograph;">
<br /></div>
<div align="justify" class="MsoNormal" style="margin-left: 24.0000pt; mso-char-indent-count: -2.0000; text-align: justify; text-indent: -24.0000pt; text-justify: inter-ideograph;">
The code to draw the vertical lines is shown below:</div>
<div align="justify" class="MsoNormal" style="margin-left: 24.0000pt; mso-char-indent-count: -2.0000; text-align: justify; text-indent: -24.0000pt; text-justify: inter-ideograph;">
<br /></div>
<div align="justify" class="MsoNormal" style="margin-left: 24.0000pt; mso-char-indent-count: -2.0000; text-align: justify; text-indent: -24.0000pt; text-justify: inter-ideograph;">
turtle.setheading(90)</div>
<div align="justify" class="MsoNormal" style="margin-left: 24.0000pt; mso-char-indent-count: -2.0000; text-align: justify; text-indent: -24.0000pt; text-justify: inter-ideograph;">
drawVerticalLines(20, -180, 15, 10, length)</div>
<div align="justify" class="MsoNormal" style="margin-left: 24.0000pt; mso-char-indent-count: -2.0000; text-align: justify; text-indent: -24.0000pt; text-justify: inter-ideograph;">
<br /></div>
<div align="justify" class="MsoNormal" style="margin-left: 24.0000pt; mso-char-indent-count: -2.0000; text-align: justify; text-indent: -24.0000pt; text-justify: inter-ideograph;">
The code to draw the horizontal lines is shown below:</div>
<div align="justify" class="MsoNormal" style="margin-left: 24.0000pt; mso-char-indent-count: -2.0000; text-align: justify; text-indent: -24.0000pt; text-justify: inter-ideograph;">
<br /></div>
<div align="justify" class="MsoNormal" style="margin-left: 24.0000pt; mso-char-indent-count: -2.0000; text-align: justify; text-indent: -24.0000pt; text-justify: inter-ideograph;">
turtle.setheading(0)</div>
<div align="justify" class="MsoNormal" style="margin-left: 24.0000pt; mso-char-indent-count: -2.0000; text-align: justify; text-indent: -24.0000pt; text-justify: inter-ideograph;">
drawHorizontalLines(0, -160, 15, 10, length)</div>
<div align="justify" class="MsoNormal" style="margin-left: 24.0000pt; mso-char-indent-count: -2.0000; text-align: justify; text-indent: -24.0000pt; text-justify: inter-ideograph;">
<br /></div>
<div align="justify" class="MsoNormal" style="margin-left: 24.0000pt; mso-char-indent-count: -2.0000; text-align: justify; text-indent: -24.0000pt; text-justify: inter-ideograph;">
</div>
<div align="justify" class="MsoNormal" style="margin-left: 24.0000pt; mso-char-indent-count: -2.0000; text-align: justify; text-indent: -24.0000pt; text-justify: inter-ideograph;">
The generated image is shown below:</div>
<div align="justify" class="MsoNormal" style="margin-left: 24.0000pt; mso-char-indent-count: -2.0000; text-align: justify; text-indent: -24.0000pt; text-justify: inter-ideograph;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjQmnEGdae9q3EBaU5Mc-a3FCuEyv_ryMnSdQ42zu1wtJgNId7QcGuox93-2L_EElhmKuZoYgXYnACmoiOBwn6Pdb-bi62uak23ETrRa_xptiklRwIzGUMVlNk1eJ5_TNkNOrtnaz4hME/s1600/Final+Symbol.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="406" data-original-width="406" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjQmnEGdae9q3EBaU5Mc-a3FCuEyv_ryMnSdQ42zu1wtJgNId7QcGuox93-2L_EElhmKuZoYgXYnACmoiOBwn6Pdb-bi62uak23ETrRa_xptiklRwIzGUMVlNk1eJ5_TNkNOrtnaz4hME/s320/Final+Symbol.png" width="320" /></a></div>
<div class="MsoNormal" style="margin-left: 24pt; text-align: center; text-indent: -24pt;">
<span style="font-size: 12pt;"><br /></span></div>
<div align="justify" class="MsoNormal" style="margin-left: 24.0000pt; mso-char-indent-count: -2.0000; text-align: justify; text-indent: -24.0000pt; text-justify: inter-ideograph;">
<u>Conclusion</u></div>
<div align="justify" class="MsoNormal" style="margin-left: 24.0000pt; mso-char-indent-count: -2.0000; text-align: justify; text-indent: -24.0000pt; text-justify: inter-ideograph;">
<br /></div>
<div align="justify" class="MsoNormal" style="margin-left: 24.0000pt; mso-char-indent-count: -2.0000; text-align: justify; text-indent: -24.0000pt; text-justify: inter-ideograph;">
We have succeeded in drawing the Kuronti ne Akwamu symbol.</div>
<div align="justify" class="MsoNormal" style="margin-left: 24.0000pt; mso-char-indent-count: -2.0000; text-align: justify; text-indent: -24.0000pt; text-justify: inter-ideograph;">
<br /></div>
<div align="justify" class="MsoNormal" style="margin-left: 24.0000pt; mso-char-indent-count: -2.0000; text-align: justify; text-indent: -24.0000pt; text-justify: inter-ideograph;">
</div>
<div align="justify" class="MsoNormal" style="margin-left: 24.0000pt; mso-char-indent-count: -2.0000; text-align: justify; text-indent: -24.0000pt; text-justify: inter-ideograph;">
This post is part of the series: <a href="http://trustonteachestech.blogspot.com.ng/p/drawing-adinkra-symbols-using-python.html" target="_blank">Drawing Adinkra Symbols using Python</a>. The goal is to draw 40 Adinkra</div>
<div align="justify" class="MsoNormal" style="margin-left: 24.0000pt; mso-char-indent-count: -2.0000; text-align: justify; text-indent: -24.0000pt; text-justify: inter-ideograph;">
symbols using the Python programming language.</div>
</div>
<div>
<br /></div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7654257377456795992.post-66938396344294753342018-03-29T21:54:00.000-07:002018-03-29T21:54:00.549-07:00Abusua Pa<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjc36I5DwoMOddciD4H4GW45OQOl3MMZyGSmp15iIY6BeOLtjKxsEZqrwdgilPIdAf96fy6JadtOCCuB7rHcHeiw4CtVwuOEuqaCLzGouFr1Hw2B7burlK3sT67oBOIzaO-iJekuuNw21M/s1600/Abusua+Pa.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="200" data-original-width="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjc36I5DwoMOddciD4H4GW45OQOl3MMZyGSmp15iIY6BeOLtjKxsEZqrwdgilPIdAf96fy6JadtOCCuB7rHcHeiw4CtVwuOEuqaCLzGouFr1Hw2B7burlK3sT67oBOIzaO-iJekuuNw21M/s1600/Abusua+Pa.png" /></a></div>
<div style="text-align: center;">
<br /></div>
Abusua Pa means "Good Family". It is the symbol for the family unit.<br />
<br />
We will use the 5 pixel grid to trace out this image. The image of this is shown below:<br />
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEidPgJq9M1CefnToerI_E3wK7FmIJogZsYJNFJE_7FxukM3-_VszEi6tMfDTtWGduAJW_ggmGYaH9C1IUSri-4Z4L3VtYy-vGVXOri5GIPLZiqAN49KAf9wTMvNo4w5lPHlki3twG78gR4/s1600/Grid.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="200" data-original-width="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEidPgJq9M1CefnToerI_E3wK7FmIJogZsYJNFJE_7FxukM3-_VszEi6tMfDTtWGduAJW_ggmGYaH9C1IUSri-4Z4L3VtYy-vGVXOri5GIPLZiqAN49KAf9wTMvNo4w5lPHlki3twG78gR4/s1600/Grid.png" /></a></div>
<div style="text-align: center;">
<br /></div>
<div>
The plan to draw this shape is given below:</div>
<div>
<ol>
<li>Lift up the pen</li>
<li>Increase the pensize to 40</li>
<li>Move it to the lower left hand corner of the outer square (-100, -100)</li>
<li>Place the pen down</li>
<li>Move forward to the position (100, -100)</li>
<li>Turn left by 90 degrees</li>
<li>Repeat steps 5 and 6 3 times</li>
<li>Draw the center lines</li>
<li>Draw the outer circles</li>
<li>Reduce the pensize to 5</li>
<li>Draw the inner squares</li>
</ol>
<div>
<u>Using Python Turtle</u></div>
</div>
<div>
<br /></div>
<div>
<div>
We will use the template.py file and rename it to abusuapa.py.</div>
<div>
<br /></div>
<div>
The code for steps 1 and 2 is given below:</div>
<div>
<br /></div>
<div>
turtle.penup()</div>
<div>
turtle.pensize(40)</div>
<div>
<br /></div>
<div>
To move the pen to the lower left hand corner, we have to use the setposition function. The position we want to move it to is (-10, -10). The code to do this is shown below:</div>
<div>
<br /></div>
<div>
turtle.setposition(-100, -100)</div>
<div>
turtle.pendown()</div>
<div>
<br /></div>
<div>
To find the distance between to points, we use the coordinateDistance function which is shown below:</div>
</div>
<div>
<br /></div>
<div>
<div>
def coordinateDistance(x1, y1, x2, y2):</div>
<div>
<span style="white-space: pre;"> </span>dx = x1 - x2</div>
<div>
<span style="white-space: pre;"> </span>dy = y1 - y2</div>
<div>
<span style="white-space: pre;"> </span>D = math.sqrt((dx * dx) + (dy * dy))</div>
<div>
<span style="white-space: pre;"> </span>return D</div>
<div>
<span style="white-space: pre;"> </span></div>
<div>
We calculate the length between the two points using the code shown below:</div>
</div>
<div>
<br /></div>
<div>
<div>
length = coordinateDistance(-100, -100, 100, -100)</div>
<div>
<br /></div>
<div>
Rather than repeat steps 5, 6 and 7 we shall use the drawSquare function. The code to do this is shown below:</div>
<div>
<br /></div>
<div>
drawSquare(length)</div>
<div>
<br /></div>
<div>
For this to work, we need to comment out the turtle.reset command in the drawSquare function. The generated image is now shown below:</div>
</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxeRT_8w1ecivfceH5Uyj3YMKKDs0A3A3f7b4saOI5n-z3wwMhKsfzJQ5F7F3ZgcT2Lh4pH2cVnwmiubl2OhAl6r1Q4_mQr_fT1TvjonlWPLRSWMn2ksYu1V1j4bSEWwZyHAq2PdqjVME/s1600/Outer+Square.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="403" data-original-width="402" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxeRT_8w1ecivfceH5Uyj3YMKKDs0A3A3f7b4saOI5n-z3wwMhKsfzJQ5F7F3ZgcT2Lh4pH2cVnwmiubl2OhAl6r1Q4_mQr_fT1TvjonlWPLRSWMn2ksYu1V1j4bSEWwZyHAq2PdqjVME/s320/Outer+Square.png" width="319" /></a></div>
<div style="text-align: center;">
<br /></div>
<div>
<div>
I realize that since we are using the drawSquare function, we no longer need the setposition code. We can comment it out.</div>
<div>
<br /></div>
<div>
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:</div>
<div>
<br /></div>
<div>
turtle.setposition(-100, 0)</div>
<div>
turtle.pendown()</div>
<div>
turtle.forward(length)</div>
<div>
turtle.penup()</div>
<div>
turtle.setheading(90)</div>
<div>
turtle.setposition(0, -100)</div>
<div>
turtle.pendown()</div>
<div>
turtle.forward(length)</div>
<div>
<br /></div>
<div>
The generated image is shown below:</div>
</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEia0Cgu0Dl9CYHox9ZXKt-43wR94F1NHma5CYS3w0Eo_uZgBR0V8lsAa0uhYgq3FEcxxU0fnkXaE3m1ggX4HjPpHFDnXxSUsM_1N_3bBxdGJXDKtXp3PUJys7QU0gfWrpgLd6_esNm70IY/s1600/Center+Lines.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="403" data-original-width="403" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEia0Cgu0Dl9CYHox9ZXKt-43wR94F1NHma5CYS3w0Eo_uZgBR0V8lsAa0uhYgq3FEcxxU0fnkXaE3m1ggX4HjPpHFDnXxSUsM_1N_3bBxdGJXDKtXp3PUJys7QU0gfWrpgLd6_esNm70IY/s320/Center+Lines.png" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
<div>
<div>
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 (60, 120). Then we draw the semi-circle. The code to do this is shown below:</div>
<div>
<br /></div>
<div>
turtle.penup()</div>
<div>
turtle.setposition(50, 120)</div>
<div>
turtle.pendown()</div>
<div>
turtle.circle(50, 180)</div>
<div>
<br /></div>
<div>
The generated image is shown below:</div>
</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiA4zOrllBXW3lpjpe1OwptnHQbGUWGnm_7LJU_XRNoy5YS3XihHCysFFJdbfsZ11uOpZoiQKowGA7SXZNnBF1GDmuiO66SQ2CG2jsZXa113Ct9244lU92tzDCG-vwCkg9rFI9jzyTXyz4/s1600/First+Semi+Circle.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="404" data-original-width="404" height="319" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiA4zOrllBXW3lpjpe1OwptnHQbGUWGnm_7LJU_XRNoy5YS3XihHCysFFJdbfsZ11uOpZoiQKowGA7SXZNnBF1GDmuiO66SQ2CG2jsZXa113Ct9244lU92tzDCG-vwCkg9rFI9jzyTXyz4/s320/First+Semi+Circle.png" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
<div>
<div>
To draw the remaining semi-circles, we move clockwise and also change the heading of our turtle accordingly. The code to do this is shown below:</div>
<div>
<br /></div>
<div>
turtle.penup()</div>
<div>
turtle.setposition(120, -50)</div>
<div>
turtle.setheading(0)</div>
<div>
turtle.pendown()</div>
<div>
turtle.circle(50, 180)</div>
<div>
<br /></div>
<div>
turtle.penup()</div>
<div>
turtle.setposition(-50, -120)</div>
<div>
turtle.setheading(270)</div>
<div>
turtle.pendown()</div>
<div>
turtle.circle(50, 180)</div>
<div>
<br /></div>
<div>
turtle.penup()</div>
<div>
turtle.setposition(-120, 50)</div>
<div>
turtle.setheading(180)</div>
<div>
turtle.pendown()</div>
<div>
turtle.circle(50, 180)</div>
<div>
<br /></div>
<div>
The generated image is shown below:</div>
</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhCP-2po5z8F9taY1aDaxDhnp6ubw0QTzK-kxDJjYbvT4LYRjLBvjXC3oOm-hxf30VMukw6hHd9StpqwKtCKVEbkC0ey_H9EMTb6Btd2j6ZpUy4_ga0itPb2D9xDw4U5mrWbVT0BThxWKI/s1600/Outer+Semi+Circles.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="402" data-original-width="403" height="318" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhCP-2po5z8F9taY1aDaxDhnp6ubw0QTzK-kxDJjYbvT4LYRjLBvjXC3oOm-hxf30VMukw6hHd9StpqwKtCKVEbkC0ey_H9EMTb6Btd2j6ZpUy4_ga0itPb2D9xDw4U5mrWbVT0BThxWKI/s320/Outer+Semi+Circles.png" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
<div>
<div>
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.</div>
<div>
<br /></div>
<div>
The code to do this is shown below:</div>
<div>
<br /></div>
<div>
turtle.penup()</div>
<div>
turtle.pensize(5)</div>
<div>
turtle.setposition(-60, -100)</div>
<div>
turtle.setheading(90)</div>
<div>
turtle.pendown()</div>
<div>
turtle.forward(length)</div>
<div>
<br /></div>
<div>
turtle.penup()</div>
<div>
turtle.setposition(-40, -100)</div>
<div>
turtle.setheading(90)</div>
<div>
turtle.pendown()</div>
<div>
turtle.forward(length)</div>
<div>
<br /></div>
<div>
turtle.penup()</div>
<div>
turtle.setposition(40, -100)</div>
<div>
turtle.setheading(90)</div>
<div>
turtle.pendown()</div>
<div>
turtle.forward(length)</div>
<div>
<br /></div>
<div>
turtle.penup()</div>
<div>
turtle.setposition(60, -100)</div>
<div>
turtle.setheading(90)</div>
<div>
turtle.pendown()</div>
<div>
turtle.forward(length)</div>
</div>
<div>
<br /></div>
<div>
The generated image is shown below:</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWAWNiWoeUfj82yDwTEXNfahKTsIVSX1Zi9ThJs7-18ctAOv9hhhoV4v_PbBUVCyYQS4h3rs0y8wJr2FMPYWPiZMOhttz0Wtqp0ROgdzHkDZYL5NNzwer9tl3kHPimqBmbSXJeacqi-gE/s1600/Vertical+Lines.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="402" data-original-width="401" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWAWNiWoeUfj82yDwTEXNfahKTsIVSX1Zi9ThJs7-18ctAOv9hhhoV4v_PbBUVCyYQS4h3rs0y8wJr2FMPYWPiZMOhttz0Wtqp0ROgdzHkDZYL5NNzwer9tl3kHPimqBmbSXJeacqi-gE/s320/Vertical+Lines.png" width="319" /></a></div>
<div style="text-align: center;">
<br /></div>
<div>
<div>
To draw the remaining horizontal lines, I shall start from the bottom of the symbol and work my way up the code to do this is shown below:</div>
<div>
<br /></div>
<div>
turtle.penup()</div>
<div>
turtle.setposition(-100, -60)</div>
<div>
turtle.setheading(0)</div>
<div>
turtle.pendown()</div>
<div>
turtle.forward(length)</div>
<div>
<br /></div>
<div>
turtle.penup()</div>
<div>
turtle.setposition(-100, -40)</div>
<div>
turtle.setheading(0)</div>
<div>
turtle.pendown()</div>
<div>
turtle.forward(length)</div>
<div>
<br /></div>
<div>
turtle.penup()</div>
<div>
turtle.setposition(-100, 40)</div>
<div>
turtle.setheading(0)</div>
<div>
turtle.pendown()</div>
<div>
turtle.forward(length)</div>
<div>
<br /></div>
<div>
turtle.penup()</div>
<div>
turtle.setposition(-100, 60)</div>
<div>
turtle.setheading(0)</div>
<div>
turtle.pendown()</div>
<div>
turtle.forward(length)</div>
<div>
<br /></div>
<div>
The generated image is shown below:</div>
</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwBx-gm8nAIUBDNihq50kv907P0f6vVR1UfZgUDdDtKVTSMmzI5gfIOLBIfqpRqLmJeKhvmnMYkM6mTBI1fPC8pbV2tZ_aU-InKj3MRZmatupRe9hNZ0Qedb7ubXLrJwzJl4GOj5jWFv0/s1600/Final+Symbol.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="405" data-original-width="405" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwBx-gm8nAIUBDNihq50kv907P0f6vVR1UfZgUDdDtKVTSMmzI5gfIOLBIfqpRqLmJeKhvmnMYkM6mTBI1fPC8pbV2tZ_aU-InKj3MRZmatupRe9hNZ0Qedb7ubXLrJwzJl4GOj5jWFv0/s320/Final+Symbol.png" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
<div>
<div class="MsoNormal">
<u>Conclusion</u></div>
<div class="MsoNormal">
<u><br /></u></div>
<div class="MsoNormal">
We have successfully drawn the Abusua Pa symbol using the Python programming language. I would comment that it is a truly beautiful symbol.</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
This post is part of the series: <a href="http://trustonteachestech.blogspot.com.ng/p/drawing-adinkra-symbols-using-python.html" target="_blank">Drawing Adinkra Symbols using Python</a>. The goal is to draw 40 Adinkra symbols using the Python programming language.</div>
</div>
<div>
<br /></div>
<br />Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7654257377456795992.post-71232879353822684202018-03-19T14:46:00.001-07:002018-03-19T14:46:54.437-07:00Aban<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBlfSPGjsgnQr_Hd0kLG74qxENVCDf6jUpynnDus6nJIGbNSBUuHwruEZ6vc0c3Jk6eetDeepMWFM9bkCvhwmmQvglDObKip11IuoqTm8u4pD9mnQX6p4ml0goEVe7P-ulBub6-vn4o4c/s1600/Aban.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="200" data-original-width="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBlfSPGjsgnQr_Hd0kLG74qxENVCDf6jUpynnDus6nJIGbNSBUuHwruEZ6vc0c3Jk6eetDeepMWFM9bkCvhwmmQvglDObKip11IuoqTm8u4pD9mnQX6p4ml0goEVe7P-ulBub6-vn4o4c/s1600/Aban.png" /></a></div>
<div style="text-align: center;">
<br /></div>
<div>
<div>
Aban means "fortress". It is the symbol of strength and authority.</div>
<div>
<br /></div>
<div>
We will use the 5 pixel grid to trace out this image. The image of this is shown below:</div>
</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYMc0hBmmuSZcP6rpiy-o6q8Rp_afwb3a0_c46V6YBJ-ZKGtRWP0KhUeFDi4uY3j0okBeg-TNIgIyW-hX5kcRsY0NhAbWN-Qb1VGOUtnWRkElk-lbeH64Fy-nYrcOmdED81nj5JMGUCsU/s1600/Grid.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="200" data-original-width="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYMc0hBmmuSZcP6rpiy-o6q8Rp_afwb3a0_c46V6YBJ-ZKGtRWP0KhUeFDi4uY3j0okBeg-TNIgIyW-hX5kcRsY0NhAbWN-Qb1VGOUtnWRkElk-lbeH64Fy-nYrcOmdED81nj5JMGUCsU/s1600/Grid.png" /></a></div>
<div style="text-align: center;">
<br /></div>
<div>
The plan to draw this shape is given below:</div>
<div>
<ol>
<li>Lift up the pen</li>
<li>Set the heading to 45 degrees</li>
<li>Move the pen to the start position of the shape</li>
<li>Set the pen size to half of the width of the shape</li>
<li>Place the pen down</li>
<li>Move forward to draw the first line</li>
<li>Turn right by 90 degrees</li>
<li>Move forward to draw half of the first line</li>
<li>Turn left by 90 degrees</li>
<li>Move forward to draw the protruding line at a distance of 5/8 of the length</li>
<li>Lift up the pen</li>
<li>Reverse the turtle by moving back the same distance as you moved forward</li>
<li>Turn right by 90 degrees</li>
<li>Place the pen down</li>
<li>Draw the second half of the line</li>
<li>Turn right by 90 degrees</li>
<li>Move forward to draw the third line</li>
<li>Repeat steps 6 to 17 3 more times</li>
</ol>
<div>
<div>
<u>Using Turtle Graphics</u></div>
<div>
<br /></div>
<div>
We will use the template.py file and rename it to aban.py.</div>
<div>
<br /></div>
<div>
The code for steps 1 to 3 is given below:</div>
<div>
<br /></div>
<div>
turtle.penup()</div>
<div>
turtle.setheading(45)</div>
<div>
turtle.setposition(0, 80)</div>
<div>
<br /></div>
</div>
</div>
<div>
<div>
Since in step 15 the shape is draw 3 times, it is a good candidate for a function. I will call the function drawTong because a single piece of the shape looks like a tong.</div>
<div>
<br /></div>
<div>
Before we can use a function, the values we need to find are the width of the line, its length and the length of its protrusion.</div>
<div>
<br /></div>
<div>
To find the width of the line, we need to find the distance between two parallel points it passes through and this are: (120, 0) and (40, 80).</div>
<div>
<br /></div>
<div>
It starts at the point (0, 80) and moves at an angle of 45 degrees to the point (80, 160).</div>
<div>
<br /></div>
<div>
The protrusion is the size of the width of the shape.</div>
<div>
<br /></div>
<div>
To get the width and length of the shape, we will use the coordinateDistance function which is shown below:</div>
<div>
<br /></div>
<div>
def coordinateDistance(x1, y1, x2, y2):</div>
<div>
<span style="white-space: pre;"> </span>dx = x1 - x2</div>
<div>
<span style="white-space: pre;"> </span>dy = y1 - y2</div>
<div>
<span style="white-space: pre;"> </span>D = math.sqrt((dx * dx) + (dy * dy))</div>
<div>
<span style="white-space: pre;"> </span>return D</div>
</div>
<div>
<br /></div>
<div>
<div>
To find the width and length, we use the expressions below:</div>
<div>
<br /></div>
<div>
width = coordinateDistance(120, 0, 40, 80)</div>
<div>
length = coordinateDistance(0, 80, 80, 160)</div>
<div>
<br /></div>
<div>
The code for steps 4 and 5 is shown below:</div>
<div>
<br /></div>
<div>
<div>
turtle.pensize(width)</div>
<div>
turtle.pendown()</div>
<div>
<br /></div>
<div>
Steps 6 to 16 can be automated using the drawTong function. We will first write out the commands for the steps to check then we will later integrate them into the drawTong function.</div>
<div>
<br /></div>
<div>
The code for steps 6 to 10 is given below:</div>
<div>
<br /></div>
<div>
turtle.forward(length)</div>
<div>
turtle.right(90)</div>
<div>
turtle.forward(length / 2)</div>
<div>
turtle.left(90)</div>
<div>
turtle.forward(length * 5 / 8)</div>
<div>
<br /></div>
<div>
The generated image is shown below:</div>
<div>
<br /></div>
</div>
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhD9jgvVEWZVDgT8FzeNWAsz0j7K8WVounJm1GehiK7AJVEAgmvn_b8V36nDIxPYYrXxRBPLRSrPKpvGfNUrI1_dxyJLvwoPBLuIqWWwT-IiS-z_hidDnf6WoHl6aSuPC1QRBU-ao7GcT0/s1600/Half+Prong.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="405" data-original-width="405" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhD9jgvVEWZVDgT8FzeNWAsz0j7K8WVounJm1GehiK7AJVEAgmvn_b8V36nDIxPYYrXxRBPLRSrPKpvGfNUrI1_dxyJLvwoPBLuIqWWwT-IiS-z_hidDnf6WoHl6aSuPC1QRBU-ao7GcT0/s320/Half+Prong.png" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
<div>
<div>
The code to lift the pen is straightforward enough. To reverse the shape, we need to move backward the same number of steps as forward.</div>
<div>
<br /></div>
<div>
The code to do this is shown below:</div>
</div>
<div>
<br /></div>
<div>
<div>
turtle.penup()</div>
<div>
turtle.backward(length * 5 / 8)</div>
<div>
turtle.right(90)</div>
<div>
turtle.pendown()</div>
<div>
turtle.forward(length / 2)</div>
<div>
turtle.right(90)</div>
<div>
turtle.forward(length)</div>
<div>
<br /></div>
<div>
The generated image is shown below:</div>
</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNFyirPwvvS4LT1J6NK60bDkKF6HuMHkU4qYoVj84zY5ga0ZgtTsrjjBpKshPdNKA_T367czn6hLIPTWo0nzPfgKTfv7tJPZAQbgNgE2KbtbRrU72U1hyTOgFuxjJ6ms_u9kVwD2GEFow/s1600/Prong.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="405" data-original-width="405" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNFyirPwvvS4LT1J6NK60bDkKF6HuMHkU4qYoVj84zY5ga0ZgtTsrjjBpKshPdNKA_T367czn6hLIPTWo0nzPfgKTfv7tJPZAQbgNgE2KbtbRrU72U1hyTOgFuxjJ6ms_u9kVwD2GEFow/s320/Prong.png" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
<div>
<div>
Now that we have drawn on part of the symbol, we can use the code to create the drawTong function so that we don’t have to repeat ourselves.</div>
<div>
<br /></div>
<div>
The code for the function is shown below:</div>
<div>
<br /></div>
<div>
def drawTong():</div>
<div>
turtle.forward(length)</div>
<div>
turtle.right(90)</div>
<div>
turtle.forward(length / 2)</div>
<div>
turtle.left(90)</div>
<div>
turtle.forward(length * 5 / 8)</div>
<div>
turtle.penup()</div>
<div>
turtle.backward(length * 5 / 8)</div>
<div>
turtle.right(90)</div>
<div>
turtle.pendown()<br />
turtle.forward(length / 2)</div>
<div>
turtle.right(90)</div>
<div>
turtle.forward(length)</div>
</div>
<div>
<br /></div>
<div>
<div>
To draw the shape completely, we need to call this function and alternate with the setheading angle that is representative of the quadrant the function draws in. The code to do this is shown below:</div>
<div>
<br /></div>
<div>
drawTong()</div>
<div>
turtle.setheading(315)</div>
<div>
drawTong()</div>
<div>
turtle.setheading(225)</div>
<div>
drawTong()</div>
<div>
turtle.setheading(135)</div>
<div>
drawTong()</div>
<div>
<br /></div>
<div>
The generated image is shown below:</div>
</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhpQrXHVZd5WJJbXPLTX8WW0vrHvR85PZOgBPw25jlpMBX71iXhMyGgL8wDFiBh6Fcj2D3a-eXF1Gn7eS4lUZHx5zHbMeqri7V2R9H0KOyd61Ceag6MI3OwSOV7GZuYbtD0MYiyzNMxlb0/s1600/Complete+Shape.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="405" data-original-width="405" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhpQrXHVZd5WJJbXPLTX8WW0vrHvR85PZOgBPw25jlpMBX71iXhMyGgL8wDFiBh6Fcj2D3a-eXF1Gn7eS4lUZHx5zHbMeqri7V2R9H0KOyd61Ceag6MI3OwSOV7GZuYbtD0MYiyzNMxlb0/s320/Complete+Shape.png" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
<div>
<div>
Conclusion</div>
<div>
<br /></div>
<div>
At the end of this section, we have drawn the completed Aban symbol. I would advise you to go over the code and ensure you understand what each part of the code is doing.</div>
<div>
<br /></div>
<div>
This post is part of the series: <a href="http://trustonteachestech.blogspot.com.ng/p/drawing-adinkra-symbols-using-python.html" target="_blank">Drawing Adinkra Symbols using Python</a>. The goal is to draw 40 Adinkra symbols using the Python programming language.</div>
</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7654257377456795992.post-34827037514395125402018-03-12T06:15:00.000-07:002018-03-12T06:15:22.727-07:00The Series Continues<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEie9QhSOwpXUxK7VFAneyGy-DHVuYaW_Ir2wGR_1-UAntopGObq3FchDA7hZjJCNGJ5Z7APjrqhLs2_6XUmyga1NhpuPfLJNCzSl-cJPE-u7ZBdJWJSwEB4Rjo_S3ZpiIWZwB90V0mnwNw/s1600/Biafra+Flag.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="684" data-original-width="1200" height="227" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEie9QhSOwpXUxK7VFAneyGy-DHVuYaW_Ir2wGR_1-UAntopGObq3FchDA7hZjJCNGJ5Z7APjrqhLs2_6XUmyga1NhpuPfLJNCzSl-cJPE-u7ZBdJWJSwEB4Rjo_S3ZpiIWZwB90V0mnwNw/s400/Biafra+Flag.jpg" width="400" /></a></div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: left;">
Above is the Biafran flag. You would be hard pressed to convince me that the Owia A Repue symbol was not the inspiration for it. Owia A Repue is shown below:</div>
<div style="text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJxYVk4zfV8DXTf7mFzFATPNUoyV7cJrWqwwBzG59QRRvAOzgW1iOaoJaQoRZbz9KFK5Ac1yRS5Wy1Y3kTtgfHubbmhjhgutGMgM0AzuXqiij9b0CIthwyJciDYG5jR1TMCxY570s4doI/s1600/Owia+A+Repue.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="200" data-original-width="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJxYVk4zfV8DXTf7mFzFATPNUoyV7cJrWqwwBzG59QRRvAOzgW1iOaoJaQoRZbz9KFK5Ac1yRS5Wy1Y3kTtgfHubbmhjhgutGMgM0AzuXqiij9b0CIthwyJciDYG5jR1TMCxY570s4doI/s1600/Owia+A+Repue.png" /></a></div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
Owia A Repue means "Rising Sun". It is the symbol of progress, renewal, development, warmth, vitality, and energy.</div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
After writing the <a href="http://trustonteachestech.blogspot.com.ng/2018/02/conclusion.html" target="_blank">Conclusion</a> last week, I actually thought I was done with this <a href="http://trustonteachestech.blogspot.com.ng/p/drawing-adinkra-symbols-using-python.html" target="_blank">series</a>.</div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
In my mind, I thought I could kick back and relax but that was not to be the case.</div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
In placing the <a href="http://trustonteachestech.blogspot.com.ng/p/drawing-adinkra-symbols-using-python.html" target="_blank">series</a> out there, I got feedback and found <a href="http://adinkra.lassanay.net/" target="_blank">this link</a> which contains a list of 129 Adinkra symbols.</div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
The hardwork would be going through the <a href="http://adinkra.lassanay.net/" target="_blank">list</a> and finding the symbols that could be drawn using Python turtle. At the end, I have decided that 17 more symbols could be drawn.</div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
So the <a href="http://trustonteachestech.blogspot.com.ng/p/drawing-adinkra-symbols-using-python.html" target="_blank">series</a> continues.</div>
<div style="text-align: left;">
<br /></div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7654257377456795992.post-33487284402526670782018-02-28T01:57:00.000-08:002018-02-28T02:02:49.070-08:00Conclusion<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGnvbL9Wr7ZLKMsxF3z-DXwugH6RWVL7pjR7veg3nnZoHDL9TIj6rO4VgDFu86RShPSTE4hPEB-rQts6YdzNoO7SuqhunhR1-R0EyKQNH5Jhc-hfGDNoXpgTKrWPL5NUQJyx11AqLpMxA/s1600/sankofawithquote.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="243" data-original-width="540" height="180" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGnvbL9Wr7ZLKMsxF3z-DXwugH6RWVL7pjR7veg3nnZoHDL9TIj6rO4VgDFu86RShPSTE4hPEB-rQts6YdzNoO7SuqhunhR1-R0EyKQNH5Jhc-hfGDNoXpgTKrWPL5NUQJyx11AqLpMxA/s400/sankofawithquote.jpg" width="400" /></a></div>
<div style="text-align: center;">
<br /></div>
In the writing of this series, I came to discover that the <a href="http://africanholocaust.net/adinkra-symbols-meanings/" target="_blank">Adinkra</a> symbols represent one of the oldest forms of technology. They serve to transmit ideas by merely looking at them because they all mean something.<br />
<br />
In Ghana, <a href="http://africanholocaust.net/adinkra-symbols-meanings/" target="_blank">Adinkra</a> symbols are a part of everyday life. They are found in homes, churches and on clothing. That was what led to my seeing them and eventually this series.<br />
<br />
I found beauty, minimalism and symmetry at the heart of the <a href="http://africanholocaust.net/adinkra-symbols-meanings/" target="_blank">Adinkra</a> symbols. In the reading of this series, I hope that you too see it for yourself.<br />
<br />
In the writing of this series, I also realized that the <a href="http://africanholocaust.net/adinkra-symbols-meanings/" target="_blank">Adinkra</a> symbols depended on each other. Once you could draw certain symbols, you could extend that commonality to others.<br />
<br />
In this series I covered how to draw 23 out of the 63 <a href="http://africanholocaust.net/adinkra-symbols-meanings/" target="_blank">Adinkra</a> symbols that are found in this list using the Python programming language. They are 63 symbols in all but the Sankofa symbol has an alternate version. You can see both of them here:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJseZ3ESV-mhjZUXv0X_fIIe_-LJu8xz3uiomab5NBpi21add6iNv3oqRJDpLPhQgb361CPX3G5hsz5-090Wd_Ew4RlQCbumQmXkqSx-eG2VfXD7topsEZyfYSm6LKb2sSG41Ow8uBor8/s1600/Sankofa+Symbols.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="200" data-original-width="400" height="160" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJseZ3ESV-mhjZUXv0X_fIIe_-LJu8xz3uiomab5NBpi21add6iNv3oqRJDpLPhQgb361CPX3G5hsz5-090Wd_Ew4RlQCbumQmXkqSx-eG2VfXD7topsEZyfYSm6LKb2sSG41Ow8uBor8/s320/Sankofa+Symbols.png" width="320" /></a></div>
<br />
In my opinion, I prefer the bird as I am drawn to it. The meaning of Sankofa is to learn from the past.<br />
<br />
Look through the list and pick out a symbol that appeals to you. I take the Aya as my personal symbol because it tells my own story and in some ways the story of this series.<br />
<br />
The Aya is the symbol of endurance and resourcefulness. An individual who wears this symbol suggests that he has endured many adversities and outlasted much difficulty.<br />
<br />
The Aya symbol is shown below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div style="text-align: center;">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdqjp1ACzjPb1zzCar1otNxBoftslnVCVMZBEESKkDL0mSnXmvxiRRuMSM_3v1JfbVdlRrtAusgquiPnmCf0jzbkUxoTG52ouBHhLNqt8DBDgRlVJdPPgsk7qWtdZB8C-V45bfwe4s3HQ/s1600/Aya%2540High.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="200" data-original-width="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdqjp1ACzjPb1zzCar1otNxBoftslnVCVMZBEESKkDL0mSnXmvxiRRuMSM_3v1JfbVdlRrtAusgquiPnmCf0jzbkUxoTG52ouBHhLNqt8DBDgRlVJdPPgsk7qWtdZB8C-V45bfwe4s3HQ/s1600/Aya%2540High.png" /></a></div>
<br /></div>
This series represents 9 months of hard work. I have passed through a lot so I am grateful that it is finally concluded.<br />
<br />
In due course, I will release a book. But for the moment, please take time out and read through the <a href="http://trustonteachestech.blogspot.com.ng/p/drawing-adinkra-symbols-using-python.html" target="_blank">series</a>.<br />
<br />
Thank you for reading.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7654257377456795992.post-57495434641921657102018-02-27T03:43:00.000-08:002018-02-27T03:43:37.465-08:00Wuforo Dua Pa A<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgO9UW_n3W_PkGuVGjZ6vJSl9eClifbHaHroXyNE7Dx-oEr0L2hYG1CfTGUVvdYe4lzJXzkS3HSGIUa_AguSJ4Juw-p6cJeSbnXDvminEQ31-WvAOgB6-CuqOlYweDtYyu-IGdpeaPHSgU/s1600/Wuforo-Dua-Pa-A%2540High.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="200" data-original-width="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgO9UW_n3W_PkGuVGjZ6vJSl9eClifbHaHroXyNE7Dx-oEr0L2hYG1CfTGUVvdYe4lzJXzkS3HSGIUa_AguSJ4Juw-p6cJeSbnXDvminEQ31-WvAOgB6-CuqOlYweDtYyu-IGdpeaPHSgU/s1600/Wuforo-Dua-Pa-A%2540High.png" /></a></div>
<div style="text-align: center;">
<br /></div>
Wuforo Dua Pa A means “when you climb a good tree”. It is the symbol of support, cooperation and encouragement.<br />
<br />
We will use the 5 pixel grid to trace out this image. The image of this is shown below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGJWKH29vQ13IPFuBH-9uM-SPeqhQg6wQyAzXUB1ohySLI-LZPGrMA3Fdxl49ea9kY2aRYAqyisu5MTCIs1zrqy0WxlhaVVRtPBnLVYi8AqWlDKMGEWLU0n-VN5XHks2sOqvS4YVEy1dA/s1600/63+Wuforo-Dua-Pa-A.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="200" data-original-width="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGJWKH29vQ13IPFuBH-9uM-SPeqhQg6wQyAzXUB1ohySLI-LZPGrMA3Fdxl49ea9kY2aRYAqyisu5MTCIs1zrqy0WxlhaVVRtPBnLVYi8AqWlDKMGEWLU0n-VN5XHks2sOqvS4YVEy1dA/s1600/63+Wuforo-Dua-Pa-A.png" /></a></div>
<div style="text-align: center;">
<br /></div>
The plan to draw this shape is given below:<br />
<br />
<ol>
<li>Lift up the pen</li>
<li>Set the pen size to 40</li>
<li>Move the pen to the location (40, 0)</li>
<li>Place the pen down</li>
<li>Move forward by 70 pixels</li>
<li>Lift up the pen</li>
<li>Move the pen to the location (-40, 0)</li>
<li>Set the heading of the pen to 180 degrees</li>
<li>Place the pen down</li>
<li>Move forward by 70 pixels</li>
<li>Lift up the pen</li>
<li>Move the pen to the position (-170, 50)</li>
<li>Set the heading of the pen to 90 degrees</li>
<li>Place the pen down</li>
<li>Move forward by 120 pixels</li>
<li>Set the heading of the pen to 0 degrees</li>
<li>Move forward by 120 pixels</li>
<li>Lift up the pen</li>
<li>Move the pen to the position (-170, 50)</li>
<li>Set the heading of the pen to 270 degrees</li>
<li>Place the pen down</li>
<li>Move forward by 120 pixels</li>
<li>Set the heading of the pen to 0 degrees</li>
<li>Move forward by 120 pixels</li>
<li>Lift up the pen</li>
<li>Move the pen to the position (170, 50)</li>
<li>Set the heading of the pen to 90 degrees</li>
<li>Place the pen down</li>
<li>Move forward by 120 pixels</li>
<li>Set the heading of the pen to 180 degrees</li>
<li>Move forward by 120 pixels</li>
<li>Lift up the pen</li>
<li>Move the pen to the position (170, -50)</li>
<li>Set the heading of the pen to 270 degrees</li>
<li>Place the pen down</li>
<li>Move forward by 120 pixels</li>
<li>Set the heading of the pen to 0 degrees</li>
<li>Move forward by 120 pixels</li>
</ol>
<br />
<div>
<u>Using Turtle Graphics</u></div>
<div>
<div>
<br /></div>
<div>
We will use the template.py file and rename it to wuforo.py.</div>
<div>
<br /></div>
<div>
The code of the first five steps is given below:</div>
<div>
<br /></div>
<div>
turtle.penup()</div>
<div>
turtle.pensize(40)</div>
<div>
turtle.setposition(40, 0)</div>
<div>
turtle.pendown()</div>
<div>
turtle.forward()</div>
<div>
<br /></div>
<div>
The generated image is shown below:</div>
<div>
<br /></div>
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgX06_GEzduRldId1yjHiDZv0I_J6pSDcP_9WGghdKk2ofuW7MItPctpx5ZiGontXr7d8It546EjxXvjyjss3SeGFkFoPbyI59HPZUNFEIbWh3p0oVjaG5no-YXcihoEnAmICLu1Ca4Qz4/s1600/First+Vertical.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="406" data-original-width="406" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgX06_GEzduRldId1yjHiDZv0I_J6pSDcP_9WGghdKk2ofuW7MItPctpx5ZiGontXr7d8It546EjxXvjyjss3SeGFkFoPbyI59HPZUNFEIbWh3p0oVjaG5no-YXcihoEnAmICLu1Ca4Qz4/s320/First+Vertical.PNG" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
<div>
<div>
The code for steps 6 to 10 is simply to repeat the initial steps. This is given below:</div>
<div>
<br /></div>
<div>
turtle.penup()</div>
<div>
turtle.setposition(-40, 0)</div>
<div>
turtle.setheading(180)</div>
<div>
turtle.pendown()</div>
<div>
turtle.forward(70)</div>
<div>
<br /></div>
<div>
The generated image is shown below:</div>
<div>
<br /></div>
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghasH4dLvZQXNVsiXrd4A5m7TLscxDvK6OX2uM2ekLcQnZgaP80va636CHxIWpj2lAog5NNlzQY1s7R67WTFJnASMUkP-JuMmhSzleERzJLb1kFiC5h_QBF01qPeDzKnhhyDtVfpiLgEo/s1600/Second+Vertical.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="406" data-original-width="407" height="319" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghasH4dLvZQXNVsiXrd4A5m7TLscxDvK6OX2uM2ekLcQnZgaP80va636CHxIWpj2lAog5NNlzQY1s7R67WTFJnASMUkP-JuMmhSzleERzJLb1kFiC5h_QBF01qPeDzKnhhyDtVfpiLgEo/s320/Second+Vertical.PNG" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
<div>
<div>
Drawing the rest of the symbol will involve lifting up the pen and moving around the shape. We will start with the upper left quadrant, move to the lower left quadrant and follow the same pattern in the right quadrant.</div>
<div>
<br /></div>
<div>
The code for steps 11 to 16 is shown below:</div>
<div>
<br /></div>
<div>
turtle.penup()</div>
<div>
turtle.setposition(-170, 50)</div>
<div>
turtle.setheading(90)</div>
<div>
turtle.pendown()</div>
<div>
turtle.forward(120)</div>
<div>
turtle.setheading(0)</div>
<div>
turtle.forward(120)</div>
<div>
<br /></div>
<div>
The generated image is shown below:</div>
</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhthKiu-DqBLlIvNxESFDHxPNegBL7h4kXa33x8Ky07MbAYv7UjK7NZbr42pXStoGzmsxGaU1aKIihLsvcr5gpkv76INy8DsKa2knJIrVs26qRvWTC7Ns94Wg-4y_33T8Edv6O-0dxQkds/s1600/Upper+Left.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="406" data-original-width="406" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhthKiu-DqBLlIvNxESFDHxPNegBL7h4kXa33x8Ky07MbAYv7UjK7NZbr42pXStoGzmsxGaU1aKIihLsvcr5gpkv76INy8DsKa2knJIrVs26qRvWTC7Ns94Wg-4y_33T8Edv6O-0dxQkds/s320/Upper+Left.PNG" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
<div>
<div>
The code for steps 18 to 24 is shown below:</div>
<div>
<br /></div>
<div>
turtle.penup()</div>
<div>
turtle.setposition(-170, -50)</div>
<div>
turtle.setheading(270)</div>
<div>
turtle.pendown()</div>
<div>
turtle.forward(120)</div>
<div>
turtle.setheading(0)</div>
<div>
turtle.forward(120)</div>
<div>
<br /></div>
<div>
The generated image is shown below:</div>
</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh2gDcoYd5Y72z7xFpF4e2DvyeBisC_sBSKDy7OGInEzOoRhCvDkAC_gXhZR-Xs4zQvxVCW8VNgALYKm6SExuojF0j36qUqwcAEHeXLuUXqnluhyphenhyphenqO42R76V-As6B5xqv4R7WnSlpKsh-8/s1600/Lower+Left.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="406" data-original-width="406" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh2gDcoYd5Y72z7xFpF4e2DvyeBisC_sBSKDy7OGInEzOoRhCvDkAC_gXhZR-Xs4zQvxVCW8VNgALYKm6SExuojF0j36qUqwcAEHeXLuUXqnluhyphenhyphenqO42R76V-As6B5xqv4R7WnSlpKsh-8/s320/Lower+Left.PNG" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
<div>
<div>
Steps 25 to 31 will draw the parts of the symbol at the upper right hand corner. The code to do this is shown below:</div>
<div>
<br /></div>
<div>
turtle.penup()</div>
<div>
turtle.setposition(170, 50)</div>
<div>
turtle.setheading(90)</div>
<div>
turtle.pendown()</div>
<div>
turtle.forward(120)</div>
<div>
turtle.setheading(180)</div>
<div>
turtle.forward(120)</div>
<div>
<br /></div>
<div>
The generated image is shown below:</div>
</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpbDtbMxRzOo9prbN_ju6Ee4ksfb_IhmxK6YZ5TM_mKwz74IrnklOeBFcgjA7GNRzWBJ_FAy4UKQ3GcLFByHU468mE-BEbk6RT7cG81UurgXupS4CvQwJajhwjYrDLMCIPedEVyMeZOBs/s1600/Upper+Right.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="406" data-original-width="406" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpbDtbMxRzOo9prbN_ju6Ee4ksfb_IhmxK6YZ5TM_mKwz74IrnklOeBFcgjA7GNRzWBJ_FAy4UKQ3GcLFByHU468mE-BEbk6RT7cG81UurgXupS4CvQwJajhwjYrDLMCIPedEVyMeZOBs/s320/Upper+Right.PNG" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
<div>
<div>
To complete this symbol, the code for the lower left part is shown below:</div>
<div>
<br /></div>
<div>
turtle.penup()</div>
<div>
turtle.setposition(170, -50)</div>
<div>
turtle.setheading(270)</div>
<div>
turtle.pendown()</div>
<div>
turtle.forward(120)</div>
<div>
turtle.setheading(180)</div>
<div>
turtle.forward(120)</div>
<div>
<br /></div>
<div>
The generated image is shown below:</div>
</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhSvTQV5p84HJ_XtxpBuqOi4sh3OpYoQi1fLISiyETIOu4-dxU5C1xJAIiwMjpJVuMDPqy7u-Yp_tBWSshIHhfxNOKtq0kohKsvk_cxoT5GjdPZ1vXSh8xahpHYTQWfeOaFGauq90Fa4q8/s1600/Final+Symbol.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="407" data-original-width="406" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhSvTQV5p84HJ_XtxpBuqOi4sh3OpYoQi1fLISiyETIOu4-dxU5C1xJAIiwMjpJVuMDPqy7u-Yp_tBWSshIHhfxNOKtq0kohKsvk_cxoT5GjdPZ1vXSh8xahpHYTQWfeOaFGauq90Fa4q8/s320/Final+Symbol.PNG" width="319" /></a></div>
<div style="text-align: center;">
<br /></div>
<div>
<u>Conclusion</u></div>
<div>
<br /></div>
<div>
This shape wasn't much of a stretch to draw. It was based on repeating the patterns for drawing.</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7654257377456795992.post-43243788830033467582018-02-26T05:38:00.000-08:002018-02-26T05:38:10.456-08:00Owuo Atwedee<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKqrnJW-kY1xrMg8y4YoGlQYT0erG2soNQoGAVi1zi-ABSrIrR-WY4xCAP4kwI6QchktBz5jQZNfw_Y_oGefqP62DcSgDxH13XApm0LO4dLX83QrLk10MMAssEc25dbuTDDlZI52WXSIo/s1600/Owuo-Atwedee%2540High.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="200" data-original-width="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKqrnJW-kY1xrMg8y4YoGlQYT0erG2soNQoGAVi1zi-ABSrIrR-WY4xCAP4kwI6QchktBz5jQZNfw_Y_oGefqP62DcSgDxH13XApm0LO4dLX83QrLk10MMAssEc25dbuTDDlZI52WXSIo/s1600/Owuo-Atwedee%2540High.png" /></a></div>
<div style="text-align: center;">
<br /></div>
<span style="font-size: 12pt;">Owuo Atwedee</span><span style="font-size: 12pt;"> means “the ladder of death”. It is the symbol of mortality a reminder of the transitory nature of existence in this world and of the imperative to live a good life to be a worthy soul in the afterlife.</span><br />
<span style="font-size: 12pt;"><br /></span>
<div class="MsoNormal">
<span style="font-size: 12pt;">We will use the 5 pixel grid to trace out this image. The image of this is shown below:</span></div>
<div class="MsoNormal">
<span style="font-size: 12pt;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2Hlf0M-3-G9S-rJEewNsHvqNjAGsh7t1D5yxtRyI2aTDMrGEeZCNnX2bw1_dEGcuxjLk7yh73ezSUzr1Jd8wMTefA1PwxHzNXLuf2hM4ZjZql1MIdhCaY-T9qSk9gBwPSslPZRJ_ZwnE/s1600/56+Owuo-Atwedee.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="200" data-original-width="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2Hlf0M-3-G9S-rJEewNsHvqNjAGsh7t1D5yxtRyI2aTDMrGEeZCNnX2bw1_dEGcuxjLk7yh73ezSUzr1Jd8wMTefA1PwxHzNXLuf2hM4ZjZql1MIdhCaY-T9qSk9gBwPSslPZRJ_ZwnE/s1600/56+Owuo-Atwedee.png" /></a></div>
<div class="MsoNormal" style="text-align: center;">
<span style="font-size: 12pt;"><br /></span></div>
<div class="MsoNormal">
The plan to draw this shape is given below:</div>
<div class="MsoNormal">
</div>
<ol>
<li>Lift up the pen</li>
<li>Set the pen size to 50 pixels</li>
<li>Change the heading of the pen to 90 degrees</li>
<li>Move the pen to the position (-85, -165)</li>
<li>Place the pen down</li>
<li>Move forward by 330 pixels</li>
<li>Lift up the pen</li>
<li>Move the pen to the position (85, -165)</li>
<li>Repeat steps 5 to 8</li>
<li>Lift up the pen</li>
<li>Draw the first rung of the ladder at (-85, -135)</li>
<li>Draw the second rung of the ladder at (-85, -135)</li>
<li>Draw the third rung of the ladder at (-85, -135)</li>
<li>Draw the fourth rung of the ladder at (-85, -135)</li>
</ol>
<div>
<u>Using Turtle Graphics</u></div>
<div>
<br /></div>
<br />
<div>
We will use the template.py file and rename it to owuo.py.</div>
<div>
<div>
<br /></div>
<div>
The code for the first six steps is shown below:</div>
<div>
<br /></div>
<div>
turtle.penup()</div>
<div>
turtle.pensize(50)</div>
<div>
turtle.setheading(90)</div>
<div>
turtle.setposition(-85, -165)</div>
<div>
turtle.pendown()</div>
<div>
turtle.forward(330)</div>
<div>
<br /></div>
<div>
The generated image is shown below:</div>
<div>
<br /></div>
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLZ5HJ6MX1yHd5UuuhaphApFUTCZTbtbl8BLeuvPEaDX7o7dFFAS97B2wJafPkfUkkoyH8uSUXv_ao808PebL5RQeBQ1pQ1MJ4RXeLRF2sjXkCYcrBHELCkXf-bmxxwhIbnfcVI_6Ku-Y/s1600/First+Line.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="406" data-original-width="406" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLZ5HJ6MX1yHd5UuuhaphApFUTCZTbtbl8BLeuvPEaDX7o7dFFAS97B2wJafPkfUkkoyH8uSUXv_ao808PebL5RQeBQ1pQ1MJ4RXeLRF2sjXkCYcrBHELCkXf-bmxxwhIbnfcVI_6Ku-Y/s320/First+Line.PNG" width="320" /></a></div>
<div class="MsoNormal" style="text-align: center;">
<span style="font-size: 12pt;"><br /></span></div>
<div class="MsoNormal">
For steps 7 to 9, we simply need to lift up the pen, move it to the position of the next vertical lines and draw. The code to do this is shown below:</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
turtle.penup()</div>
<div class="MsoNormal">
turtle.pensize(50)</div>
<div class="MsoNormal">
turtle.setheading(90)</div>
<div class="MsoNormal">
turtle.setposition(85, -165)</div>
<div class="MsoNormal">
turtle.pendown()</div>
<div class="MsoNormal">
turtle.forward(330)</div>
<div class="MsoNormal">
</div>
<div class="MsoNormal">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmGUeS-aWiyJTkqH156GcvWGnzmcF4XwjQguiK8x0BCrsr5PwPDxUfC3BEZZ591SnYtVFLBx1yKHKp2E5WN8uYh_mkQ8DiQzYJRW9ntK1vpFdOfp_6pQd9jWZW1ysfy8BqZKRGEC_nhVA/s1600/Second+Line.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="406" data-original-width="406" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmGUeS-aWiyJTkqH156GcvWGnzmcF4XwjQguiK8x0BCrsr5PwPDxUfC3BEZZ591SnYtVFLBx1yKHKp2E5WN8uYh_mkQ8DiQzYJRW9ntK1vpFdOfp_6pQd9jWZW1ysfy8BqZKRGEC_nhVA/s320/Second+Line.PNG" width="320" /></a></div>
<div class="MsoNormal" style="text-align: center;">
<br /></div>
<div class="MsoNormal">
Draw the rungs means finding the distance from (-85, -135) to (85, 135). There is no need to use the coordinateDistance function as the distance between the two points is 170 pixels.</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
Since steps 11 to 14 are essentially the same with only the points changing, it makes a great candidate for a function. We shall create a function called drawRung which will draw the rungs of the symbol. The code for this function is given below:</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
def drawRung(x1, y1, distance):</div>
<div class="MsoNormal">
turtle.penup()</div>
<div class="MsoNormal">
turtle.setposition(x1, y1)</div>
<div class="MsoNormal">
turtle.setheading(0)</div>
<div class="MsoNormal">
turtle.pendown()</div>
<div class="MsoNormal">
turtle.forward(distance)</div>
<div class="MsoNormal">
<span class="Apple-tab-span" style="white-space: pre;"> </span></div>
<div class="MsoNormal">
All we have to do now is to call the function in our code 4 times as shown below:</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
drawRung(-85, -135, 170)</div>
<div class="MsoNormal">
drawRung(-85, -45, 170)</div>
<div class="MsoNormal">
drawRung(-85, 45, 170)</div>
<div class="MsoNormal">
drawRung(-85, 135, 170)</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
The image generated is shown below:</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIc1rsk1H4ciTcQgdhNrUm9G109eOeXAjq6O8Qzh9PBz_DyXduOeBg1RHpZslYcncyh9gR6-4YQHLzDNis0LjbOyXSGWcMQCDI5ZQsra-UgaXtaK3JLrWS8KTyv_hKb-rBK3P9bWpBas8/s1600/Final+Symbol.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="406" data-original-width="405" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIc1rsk1H4ciTcQgdhNrUm9G109eOeXAjq6O8Qzh9PBz_DyXduOeBg1RHpZslYcncyh9gR6-4YQHLzDNis0LjbOyXSGWcMQCDI5ZQsra-UgaXtaK3JLrWS8KTyv_hKb-rBK3P9bWpBas8/s320/Final+Symbol.PNG" width="319" /></a></div>
<div style="text-align: center;">
<br /></div>
<div>
<u>Conclusion</u></div>
<div>
<br /></div>
<div>
This symbol was one of the easiest symbols to draw. At last we are gradually approaching the end of this series.</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7654257377456795992.post-56971578431733940782018-02-23T01:02:00.000-08:002018-02-23T01:02:29.664-08:00Owo Foro Adobe<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmokDsDsWpYe2aTdIyhqncq6OT-N7PYMDdazg14yUGaVzW60a1UiPcLtya4B9r4HuV1I3amojZzDUVIT-foHePCCAa2UHo_qOjGL33jaZDJgvEDDC4pW1nwwiRQPrYp593VM1hyxWAvUI/s1600/Owo-Foro-Adobe%2540High.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="200" data-original-width="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmokDsDsWpYe2aTdIyhqncq6OT-N7PYMDdazg14yUGaVzW60a1UiPcLtya4B9r4HuV1I3amojZzDUVIT-foHePCCAa2UHo_qOjGL33jaZDJgvEDDC4pW1nwwiRQPrYp593VM1hyxWAvUI/s1600/Owo-Foro-Adobe%2540High.png" /></a></div>
<div style="text-align: center;">
<br /></div>
Owo Foro Adobe means "snake climbing the raffia tree". It is the symbol of steadfastness, prudence and diligence. Because of its thorns, the raffia tree is a very dangerous challenge to the snake. His ability to climb it is a model of persistence and prudence.<br />
<br />
We will use the 5 pixel grid to trace out this image. The image of this is shown below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgolS6BiuDKdJLoUz0vrEZDC3_JAXnqtMFYKPr1MkxQq7HcQz9lYHxCzEpb07czdfoe0pYhZ8TnKTcENcX4ALwAVHLOUBe7qtPFouMiUjgTYkZLSZaL-ICsBTzMOJ9fR5rUaoKSHDCkWb8/s1600/55+Owo-Foro-Adobe.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="200" data-original-width="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgolS6BiuDKdJLoUz0vrEZDC3_JAXnqtMFYKPr1MkxQq7HcQz9lYHxCzEpb07czdfoe0pYhZ8TnKTcENcX4ALwAVHLOUBe7qtPFouMiUjgTYkZLSZaL-ICsBTzMOJ9fR5rUaoKSHDCkWb8/s1600/55+Owo-Foro-Adobe.png" /></a></div>
<div style="text-align: center;">
<br /></div>
This symbol is easy to draw. It is just lines. The plan to draw the shape below is shown below:<br />
<br />
<ol>
<li>Lift up the pen</li>
<li>Move the pen to the position (-170, -90)</li>
<li>Set the pen size to 20 pixels</li>
<li>Set the angle of the pen to 45 degrees</li>
<li>Draw a line to the point (90, 170)</li>
<li>Lift up the pen</li>
<li>Move the pen to the position (-90, -170)</li>
<li>Draw a line of the same length and heading as the first line you drew</li>
<li>Lift up the pen</li>
<li>Set the pen size to 5 pixels</li>
<li>Draw the first zig zag line starting at (-170, -90)</li>
<li>Draw the second zig zag line starting at (-160, -80)</li>
<li>Draw the third zig zag line starting at (-150, -70)</li>
</ol>
<br />
<div>
<u>Using Turtle Graphics</u></div>
<div>
<div>
<br /></div>
<div>
We will use the template.py file and rename it to owoforoadobe.py.</div>
<div>
<br /></div>
<div>
The code for the first four steps is given below:</div>
<div>
<br /></div>
<div>
turtle.penup()</div>
<div>
turtle.setposition(-170, -90)</div>
<div>
turtle.pensize(20)</div>
<div>
turtle.setheading(45)</div>
</div>
<div>
<br /></div>
The coordinateDistance function is used to find the distance between (-170, -90) and (90, 170). The code to do this is shown below:<br />
<br />
inclineLength = coordinateDistance(-170, -90, 90, 170)<br />
<br />
Now we place the pen down and move forward by the inclineLength. The code to do this is shown below:<br />
<br />
turtle.pendown()<br />
turtle.forward(inclineLength)<br />
<br />
The generated image is shown below:<br />
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh24xJAUfcrR2bPzgJSg_lvfXNmZFsKcqjYpSIa5bQBEjlhuZ_mM4OYf5NUqn8tN1rOTZS6zjhObIZIuxJebTDrT3YUN6an7B1Da1dHPPZ61aFz-ExTzi4fKp0phntVOLSN_WZLT7UQClM/s1600/First+Incline.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="406" data-original-width="406" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh24xJAUfcrR2bPzgJSg_lvfXNmZFsKcqjYpSIa5bQBEjlhuZ_mM4OYf5NUqn8tN1rOTZS6zjhObIZIuxJebTDrT3YUN6an7B1Da1dHPPZ61aFz-ExTzi4fKp0phntVOLSN_WZLT7UQClM/s320/First+Incline.PNG" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
<div>
<div>
Now we are on step 6. The first step is to lift up the pen. Then we lift up the pen to the position (-90, -170). Next we set the heading of the pen and draw a line of the same length as the first line. The code to do this is shown below:</div>
<div>
<br /></div>
<div>
turtle.penup()</div>
<div>
turtle.setposition(-90, -170)</div>
<div>
turtle.setheading(45)</div>
<div>
turtle.pendown()</div>
<div>
turtle.forward(inclineLength)</div>
<div>
<br /></div>
<div>
The generated image is shown below:</div>
</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtbtYsmZRpLvAjpMvrW7KQWQUyg4FdAo1nIj9QJ-geJeFNTGGJHVo9aZggnzaocHph3Abgp2Wcvwu6OUmIMDA6Mu2hyphenhyphen55eOTK5LgNDaGczdwqO02SZl2IbpZ8RF7PjUu6nAhTkmlFG7l0/s1600/Second+Incline.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="406" data-original-width="406" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtbtYsmZRpLvAjpMvrW7KQWQUyg4FdAo1nIj9QJ-geJeFNTGGJHVo9aZggnzaocHph3Abgp2Wcvwu6OUmIMDA6Mu2hyphenhyphen55eOTK5LgNDaGczdwqO02SZl2IbpZ8RF7PjUu6nAhTkmlFG7l0/s320/Second+Incline.PNG" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
<div>
<div>
Now we lift up the pen and move it back to the point (-170, -90). Next we need to set the pen size to 2 pixels and it heading to 0 degrees. The code to do this is shown below:</div>
<div>
<br /></div>
<div>
turtle.penup()</div>
<div>
turtle.setposition(-170, -90)</div>
<div>
turtle.pensize(5)</div>
<div>
turtle.setheading(0)</div>
<div>
<br /></div>
<div>
Steps 13 to 15 repeat and would make a good candidate for a function. The use of this function will be to draw a zig zag line. This makes a good candidate for a function.</div>
<div>
<br /></div>
<div>
However, before we can create a function, we need to get the distance between two points on the line. Thankfully, with an angle of 45 degrees, all the length are equal so we only need to do this once.</div>
<div>
<br /></div>
<div>
The coordinateDistance function will be used to find the distance between (-170, -90) and (-10, -90). The code to do this is shown below:</div>
<div>
<br /></div>
<div>
rungLength = coordinateDistance(-170, -90, -10, -90)</div>
<div>
<br /></div>
<div>
The code for the zigZag function is given below:</div>
<div>
<br /></div>
<div>
def zigZag(x1, y1, distance):</div>
<div>
turtle.penup()</div>
<div>
turtle.setposition(x1, y1)</div>
<div>
turtle.pendown()</div>
<div>
turtle.setheading(0)</div>
<div>
turtle.forward(distance)</div>
<div>
turtle.setheading(90)</div>
<div>
turtle.forward(distance)</div>
<div>
turtle.setheading(0)</div>
<div>
turtle.forward(distance)</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span></div>
<div>
To call the function, all we need to do is to pass in the point we want it to get to and the distance we want it to move for. The code to do this is shown below:</div>
<div>
<br /></div>
<div>
zigZag(-170, -90, rungLength)</div>
<div>
zigZag(-160, -80, rungLength)</div>
<div>
zigZag(-150, -70, rungLength)</div>
<div>
<br /></div>
<div>
The generated image is shown below:</div>
</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0XgD_b3PiFFYLOzSdHqXch9vqmtTVVrsssXbl5sUUz8E3f1DXAFn6Dp8DNBS33Hqqx6YVEvnS-1tomjzz6sTp8t0qwRPnrNOeoIPF8ygSz6bgjHGHrHLFguzA2_CzA1TPulWCWr0IWbo/s1600/Final+Symbol.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="406" data-original-width="406" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0XgD_b3PiFFYLOzSdHqXch9vqmtTVVrsssXbl5sUUz8E3f1DXAFn6Dp8DNBS33Hqqx6YVEvnS-1tomjzz6sTp8t0qwRPnrNOeoIPF8ygSz6bgjHGHrHLFguzA2_CzA1TPulWCWr0IWbo/s320/Final+Symbol.PNG" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
<u>Conclusion</u><br />
<br />
This symbol is one of the easier symbols to draw as it is made up of just lines.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7654257377456795992.post-81047916856219209782018-02-19T06:29:00.003-08:002018-02-19T06:29:43.872-08:00Nyansapo<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghF_4QlSU9ROjnmVJ2Zw66BPxjXunYvdp2edChFZXykAj0aJCfI64ewZdTxeGu_1t0i3zz52PgpQO1T3tnHJl2Xi0_xntfSAuDvcbMrBu4TwEo7e0nMOmxga7R8tC7e-3JIWNdfRN_PWo/s1600/Nyansapo%2540High.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="200" data-original-width="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghF_4QlSU9ROjnmVJ2Zw66BPxjXunYvdp2edChFZXykAj0aJCfI64ewZdTxeGu_1t0i3zz52PgpQO1T3tnHJl2Xi0_xntfSAuDvcbMrBu4TwEo7e0nMOmxga7R8tC7e-3JIWNdfRN_PWo/s1600/Nyansapo%2540High.png" /></a></div>
<div style="text-align: center;">
<br /></div>
Nyansapo means "wisdom knot". It is the symbol of wisdom, ingenuity, intelligence and patience.<br />
<br />
We will use the 5 pixel grid to trace out this image. The image of this is shown below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXubRexY5w4zI4sTIxuQqQhTwEzWmAj7d_j7bCIWFUByY7J7Nof0aSpXrGgMGsHLnqTWHm2ByYieno7XUfc-54EWErj1Hvylj3oXz88YzsDrpmzbrXFyAExgg0s0tV8ybARk-9dRd_BfM/s1600/49+Nyansapo.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="200" data-original-width="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXubRexY5w4zI4sTIxuQqQhTwEzWmAj7d_j7bCIWFUByY7J7Nof0aSpXrGgMGsHLnqTWHm2ByYieno7XUfc-54EWErj1Hvylj3oXz88YzsDrpmzbrXFyAExgg0s0tV8ybARk-9dRd_BfM/s1600/49+Nyansapo.png" /></a></div>
<div style="text-align: center;">
<br /></div>
This symbol is easy to draw. The plan to draw this shape is shown below:<br />
<br />
<ol>
<li>Lift up the pen</li>
<li>Move the turtle to the position (0, -35)</li>
<li>Set the pen size to 10 pixels</li>
<li>Draw a circle of radius 80 pixels</li>
<li>Lift up the pen</li>
<li>Move the turtle to the position (0, -125)</li>
<li>Place the pen down</li>
<li>Draw a circle of radius 80 pixels</li>
<li>Lift up the pen</li>
<li>Move the turtle to the position (-25, -185)</li>
<li>Set the heading to 90 degrees</li>
<li>Place the pen down</li>
<li>Move forward by 150 pixels</li>
<li>Repeat steps 9 to 13 but change the position of step 10 to (25, -185)</li>
<li>Lift up the pen</li>
<li>Move the turtle to the position (-25, 185)</li>
<li>Set the heading to 270 degrees</li>
<li>Place the pen down</li>
<li>Move forward by 150</li>
<li>Repeat steps 15 to 19 but change the position of step 16 to (25, 185)</li>
<li>Lift up the pen</li>
<li>Move the turtle back to its home position</li>
<li>Change its colour to white</li>
<li>Set its heading to 270 degrees</li>
<li>Change its pen size to 40</li>
<li>Place the pen down</li>
<li>Move backward by 40 pixels</li>
<li>Move forward by 80 pixels</li>
</ol>
<br />
<div>
<u>Using Turtle Graphics</u></div>
<div>
<div>
<br /></div>
<div>
We will use the template.py file and rename it to nyansapo.py.</div>
<div>
<br /></div>
<div>
The code for the first four steps is given below:</div>
<div>
<br /></div>
<div>
turtle.penup()</div>
<div>
turtle.setposition(0, -35)</div>
<div>
turtle.pensize(10)</div>
<div>
turtle.pendown()</div>
<div>
turtle.circle(80)</div>
<div>
<br /></div>
<div>
The generated image is shown below:</div>
</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5Oh5uKFv1iOkG0419ZjQslMaogGToP_iOhQBwI4jng_QA-tF4WaEyHkqm9PgEgrgsTn3PO9R4NiyYkEQYeyHkBYcAbZimqx2gsNxZZKLMov72sS2EX0wFXLS5ZcqdM-dR7cex7rlrraM/s1600/First+Circle.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="406" data-original-width="406" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5Oh5uKFv1iOkG0419ZjQslMaogGToP_iOhQBwI4jng_QA-tF4WaEyHkqm9PgEgrgsTn3PO9R4NiyYkEQYeyHkBYcAbZimqx2gsNxZZKLMov72sS2EX0wFXLS5ZcqdM-dR7cex7rlrraM/s320/First+Circle.PNG" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
<div>
<div>
The code for steps 5 to 8 is given below:</div>
<div>
<br /></div>
<div>
turtle.penup()</div>
<div>
turtle.setposition(0, -125)</div>
<div>
turtle.pendown()</div>
<div>
turtle.circle(80)</div>
<div>
<br /></div>
<div>
The generated image is given below:</div>
</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrNPh5BI52UVa6PtpT4RPPcaGBwK-s_n83YW5s2NAAjXRSspFUrTMfjyGjTmSddGBPVCYo5GnvHT3NrBr6zE6pTbQRFoZUivg6pCrSbkvrIGlVlgVyoQDiaM0W_lLEbIBbUizCSjMP3ic/s1600/Second+Circle.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="406" data-original-width="406" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrNPh5BI52UVa6PtpT4RPPcaGBwK-s_n83YW5s2NAAjXRSspFUrTMfjyGjTmSddGBPVCYo5GnvHT3NrBr6zE6pTbQRFoZUivg6pCrSbkvrIGlVlgVyoQDiaM0W_lLEbIBbUizCSjMP3ic/s320/Second+Circle.PNG" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
<div>
<div>
The code for steps, 9 to 13 is given below:</div>
<div>
<br /></div>
<div>
turtle.penup()</div>
<div>
turtle.setposition(-25, -185)</div>
<div>
turtle.setheading(90)</div>
<div>
turtle.pendown()</div>
<div>
turtle.forward(150)</div>
<div>
<br /></div>
<div>
The code for step 14 is given below:</div>
<div>
<br /></div>
<div>
turtle.penup()</div>
<div>
turtle.setposition(25, -185)</div>
<div>
turtle.setheading(90)</div>
<div>
turtle.pendown()</div>
<div>
turtle.forward(150)</div>
<div>
<br /></div>
<div>
The generated image is shown below:</div>
</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJcZ5ilkBLfgz1k3nuX7LlIqkwr8jA7imN_Pudi5mOqB-yYwijxNllYsuaVax8ThXZRndV0Hw3pHSq6H6t5q4tOoFDQ-b4luXNz-BEqWT2JWkIL0ygoEJmYSDIIp21qrxczwQY3WhnlZs/s1600/Lower+Lines.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="406" data-original-width="406" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJcZ5ilkBLfgz1k3nuX7LlIqkwr8jA7imN_Pudi5mOqB-yYwijxNllYsuaVax8ThXZRndV0Hw3pHSq6H6t5q4tOoFDQ-b4luXNz-BEqWT2JWkIL0ygoEJmYSDIIp21qrxczwQY3WhnlZs/s320/Lower+Lines.PNG" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
The code for steps 15 to 19 is given below:<br />
<br />
turtle.penup()<br />
turtle.setposition(25, 185)<br />
turtle.setheading(270)<br />
turtle.pendown()<br />
turtle.forward(150)<br />
<br />
The code for step 20 is given below:<br />
<br />
turtle.penup()<br />
turtle.setposition(-25, 185)<br />
turtle.setheading(270)<br />
turtle.pendown()<br />
turtle.forward(150)<br />
<br />
The generated image is shown below:<br />
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqPTxa44q4qH2oUazmV4e-INCUGLaMPxoJ3BFPSMEkw4XlVXtomvGDmWw8PIzaG1voSTJW9e89owIpc5EeXYozGp0sQ2OOWEPo-nsd-dninTHNYxliiKtDURyPqzphpjLQ9sOHEziWAag/s1600/Upper+Lines.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="406" data-original-width="406" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqPTxa44q4qH2oUazmV4e-INCUGLaMPxoJ3BFPSMEkw4XlVXtomvGDmWw8PIzaG1voSTJW9e89owIpc5EeXYozGp0sQ2OOWEPo-nsd-dninTHNYxliiKtDURyPqzphpjLQ9sOHEziWAag/s320/Upper+Lines.PNG" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
<div>
<div>
The code for steps 21 to 28 is given below:</div>
<div>
<br /></div>
<div>
turtle.penup()</div>
<div>
turtle.home()</div>
<div>
turtle.color(“white”, “white”)</div>
<div>
turtle.setheading(270)</div>
<div>
turtle.pensize(40)</div>
<div>
turtle.pendown()</div>
<div>
turtle.backward(40)</div>
<div>
turtle.forward(80)</div>
<div>
<br /></div>
<div>
The generated image is shown below:</div>
<div>
<br /></div>
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHZ62RWD_7FwGgwITnugWRZ8G_3PJlqhIIu9FnPVjLvADltB_ZK1L_E6P_UTXex03M67w8vHJasRFzKJjHYtSnBpTx0X7BLe4Dei3mlIIPVy4kxTqCq7y5uxbKv3QKrOGYUrRE5nAluck/s1600/Final+Symbol.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="407" data-original-width="406" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHZ62RWD_7FwGgwITnugWRZ8G_3PJlqhIIu9FnPVjLvADltB_ZK1L_E6P_UTXex03M67w8vHJasRFzKJjHYtSnBpTx0X7BLe4Dei3mlIIPVy4kxTqCq7y5uxbKv3QKrOGYUrRE5nAluck/s320/Final+Symbol.PNG" width="319" /></a></div>
<div style="text-align: center;">
<br /></div>
<div>
<u>Conclusion</u></div>
<div>
<u><br /></u></div>
<div>
We have succeeded in drawing the symbol Nyansapo. It wasn't so difficult to draw.</div>
<div>
<br /></div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7654257377456795992.post-58393761176930268612018-02-16T02:47:00.002-08:002018-02-16T02:47:50.789-08:00Nyame Nnwu Na Me Wu<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjOuoCW9BH8SNHn7mSoqHI3fuIJkHdT_3LjxxU1gEUCx_sZCgWArw0dxB7129SrXGFnUbcoywbfcJyJPYtkX1msq_qatvXVH4j4CCh000eOpOfb64nT65PzCwKLECZlA9TE5OOphuXPyHs/s1600/Nyame-Nnwu-Na-Me-Wu%2540High.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="200" data-original-width="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjOuoCW9BH8SNHn7mSoqHI3fuIJkHdT_3LjxxU1gEUCx_sZCgWArw0dxB7129SrXGFnUbcoywbfcJyJPYtkX1msq_qatvXVH4j4CCh000eOpOfb64nT65PzCwKLECZlA9TE5OOphuXPyHs/s1600/Nyame-Nnwu-Na-Me-Wu%2540High.png" /></a></div>
<div style="text-align: center;">
<br /></div>
<br />
Nyame Nnwu Na Me Wu means "God never dies, therefore I cannot die". It is the symbol of God's omnipresence and the perpetual existence of man's spirit. This signifies the immortality of man's soul, believed to be a part of God. Because the soul rests with God after death, it cannot die.<br />
<br />
We will use the 5 pixel grid to trace out this image. The image of this is shown below:<br />
<div style="text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAvhAKipUe6AMUAJzyeJT6wlu5O8xHU-C2ESk-ylUhfUs779W2EJqZWV6Sm5wf1LFrOGgi7WQFRfQZ9F0_ILVJFT6nrZMXqViGnJSKvQucuC5j3unG5U1h_XJoXfygX1zPgv04e6yy5Ns/s1600/46+Nyame-Nnwu-Na-Me-Wu.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="200" data-original-width="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAvhAKipUe6AMUAJzyeJT6wlu5O8xHU-C2ESk-ylUhfUs779W2EJqZWV6Sm5wf1LFrOGgi7WQFRfQZ9F0_ILVJFT6nrZMXqViGnJSKvQucuC5j3unG5U1h_XJoXfygX1zPgv04e6yy5Ns/s1600/46+Nyame-Nnwu-Na-Me-Wu.png" /></a></div>
<div style="text-align: center;">
<br /></div>
This function is a composite made up of circles and line. We need to know where the circles are in order to draw this shape.<br />
<br />
The plan to draw this symbol is given below:<br />
<br />
<ol>
<li>Lift up the pen</li>
<li>Change the pen size to 10 pixels</li>
<li>Draw the upper left circle</li>
<li>Draw the lower left circle</li>
<li>Draw the upper right circle</li>
<li>Draw the lower right circle</li>
<li>Change the pen size to 30 pixels</li>
<li>Draw a line from the upper left circle to the lower right circle</li>
<li>Draw a line from the upper right circle to the lower left circle</li>
<li>Change the pen size to 10 pixels</li>
<li>Change its colour to white</li>
<li>Draw a line from the upper left circle to the lower right circle</li>
<li>Draw a line from the upper right circle to the lower left circle</li>
</ol>
<div>
<br /></div>
<br />
<u>Using Turtle Graphics</u><br />
<br />
We will use the template.py file and rename it to nyame.py.<br />
<br />
The code for the first two steps is given below:<br />
<br />
turtle.penup()<br />
turtle.pensize(10)<br />
<br />
To draw the upper left circle, we have to know its position. The position of the upper left circle is at (-125, 70). The circle has a radius of 50 pixels.<br />
<br />
The code to draw the circle is as follow:<br />
<br />
turtle.penup()<br />
turtle.setposition(-125, 75)<br />
turtle.pendown()<br />
turtle.circle(50)<br />
<br />
The position of the lower left circle is at (-125, -180). The code to draw it is given below:<br />
<br />
turtle.penup()<br />
turtle.setposition(-125, -175)<br />
turtle.pendown()<br />
turtle.circle(50)<br />
<br />
The position of the upper right circle is at (125, 70). The code to draw it is given below:<br />
<br />
turtle.penup()<br />
turtle.setposition(125, 75)<br />
turtle.pendown()<br />
turtle.circle(50)<br />
<br />
The position of the lower right circle is at (125, -180). The code to draw it is given below:<br />
<br />
turtle.penup()<br />
turtle.setposition(125, -175)<br />
turtle.pendown()<br />
turtle.circle(50)<br />
<br />
The generated image is shown below:<br />
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQRM-NbxLqI2ClU9z2jJxobvy3Xu-DIfOfa4dykXjMnuqlfR-MOH7-guQA06Co-JfYbgjoJ4nVzR41pfV8vI_1hG_l_Apvn7HkIoZssB6gDZi0L_JXJKsFx-LikgiRqruE5Uz-HfTCRGM/s1600/Four+Circles.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="406" data-original-width="406" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQRM-NbxLqI2ClU9z2jJxobvy3Xu-DIfOfa4dykXjMnuqlfR-MOH7-guQA06Co-JfYbgjoJ4nVzR41pfV8vI_1hG_l_Apvn7HkIoZssB6gDZi0L_JXJKsFx-LikgiRqruE5Uz-HfTCRGM/s320/Four+Circles.PNG" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
<div>
<div>
At step 7 we lift up the pen and increase the pen size to 30 pixels. The code to do this is shown below:</div>
<div>
<br /></div>
<div>
turtle.penup()</div>
<div>
turtle.pensize(30)</div>
<div>
<br /></div>
<div>
The coordinate of the point for the joining line between the upper left circle and the lower right circle is (-90, 90) and (90, -90).</div>
<div>
<br /></div>
<div>
We will use the coordinateDistance function to find the distance between the two points since we already know the the orientation between them is a factor of 45 degrees. The code to do this is written below:</div>
<div>
<br /></div>
<div>
pointDistance = coordinateDistance(-90, 90, 90, -90)</div>
<div>
<br /></div>
<div>
Now that we know the distance between the 2 points, we move the pen back to the upper left circle and set its heading to -45 degrees. The code to do this is shown below:</div>
<div>
<br /></div>
<div>
turtle.setposition(-90, 90)</div>
<div>
turtle.setheading(-45)</div>
<div>
turtle.pendown()</div>
<div>
turtle.forward(pointDistance)</div>
<div>
<br /></div>
<div>
The generated image is shown below:</div>
</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWAEC-Glx34LbLYLtGmaJ7cl_V1PoLpKHeW59NHje7VZMgbAt9z8jeRfvjhE6i1IS55g9WkFz8Wk0jym2m-bexJOIQFPiDI1IOLxDC2mHR3ZWcRS-OW0lt6r7RJNQ2mrlK1ZyqSSmHhAc/s1600/First+Line.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="406" data-original-width="406" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWAEC-Glx34LbLYLtGmaJ7cl_V1PoLpKHeW59NHje7VZMgbAt9z8jeRfvjhE6i1IS55g9WkFz8Wk0jym2m-bexJOIQFPiDI1IOLxDC2mHR3ZWcRS-OW0lt6r7RJNQ2mrlK1ZyqSSmHhAc/s320/First+Line.PNG" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
<div>
<div>
We lift up the pen and move it to the upper left quadrant. We set the orientation of the turtle to 225 degrees and we draw the line. The code to do this is shown below:</div>
<div>
<br /></div>
<div>
turtle.penup()</div>
<div>
turtle.setposition(90, 90)</div>
<div>
turtle.setheading(225)</div>
<div>
turtle.pendown()</div>
<div>
turtle.forward(pointDistance)</div>
<div>
<br /></div>
<div>
The generated image is shown below:</div>
</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiVNg0P3CcWImN5sS5FX_Qk1HyeZ2WH8y13WvR7KCog_Ra2U4WOnwpluIn-d27UedLZBjY84fDy9xDE2CfAdOY8gDVa6ywmX-_E2fNqRj8Hgui6ww_JYTzjFwjPwqGxVb6inUlnEJFwy5A/s1600/Second+Line.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="406" data-original-width="406" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiVNg0P3CcWImN5sS5FX_Qk1HyeZ2WH8y13WvR7KCog_Ra2U4WOnwpluIn-d27UedLZBjY84fDy9xDE2CfAdOY8gDVa6ywmX-_E2fNqRj8Hgui6ww_JYTzjFwjPwqGxVb6inUlnEJFwy5A/s320/Second+Line.PNG" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
<div>
<div>
Now we are at step 10. The code to change the pen size to 10 pixels is given below:</div>
<div>
<br /></div>
<div>
turtle.penup()</div>
<div>
turtle.pensize(10)</div>
<div>
<br /></div>
<div>
To change the colour of the pen to white, the code to do this is shown below:</div>
<div>
<br /></div>
<div>
turtle.color(“white”, “white”)</div>
<div>
<br /></div>
<div>
Now the pen will be moved back to the position we drew from in both cases. Then we will place the pen down, move backward by 10 pixels and move forward by 10 pixels. This will help to clean out the blot lines. The code to do this is shown below:</div>
<div>
<br /></div>
<div>
turtle.setposition(-90, 90)</div>
<div>
turtle.setheading(-45)</div>
<div>
turtle.pendown()</div>
<div>
turtle.backward(10)</div>
<div>
turtle.forward(pointDistance + 20)</div>
<div>
<br /></div>
<div>
We repeat this steps again but this time we move the turtle to the upper right circle. The code for this is shown below:</div>
<div>
<br /></div>
<div>
turtle.penup()</div>
<div>
turtle.setposition(90, 90)</div>
<div>
turtle.setheading(225)</div>
<div>
turtle.pendown()</div>
<div>
turtle.backward(10)</div>
<div>
turtle.forward(pointDistance + 20)</div>
<div>
<br /></div>
<div>
The generated image is shown below:</div>
</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAFIO_wBu4QpybcNt6Zi6khmy-ThLdVeGphaxl0U8fpLMJZOhuI3EgOb11m5dRPwkbG4vlHFdt-nA78W3NWDZ-_s36Vc_4SOWhGiS6qjk9n1LiKAbFIqJC6PFS4UBxy4k4ApqTTLpItt4/s1600/Final+Symbol.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="406" data-original-width="406" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAFIO_wBu4QpybcNt6Zi6khmy-ThLdVeGphaxl0U8fpLMJZOhuI3EgOb11m5dRPwkbG4vlHFdt-nA78W3NWDZ-_s36Vc_4SOWhGiS6qjk9n1LiKAbFIqJC6PFS4UBxy4k4ApqTTLpItt4/s320/Final+Symbol.PNG" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
<div>
<u>Conclusion</u></div>
<div>
<br /></div>
<div>
We have finished drawing the basic shape. A technique to make it perfect would be to initially draw the circles as filled shapes.</div>
<div>
<br /></div>
<div>
This symbol is truly deep.</div>
Unknownnoreply@blogger.com0