Geometry and Programming: How to draw shapes: a triangle, star and rectangle without math
This tutorial is show you how to draw a triangle, star and rectangle in one of the computer programming language in this case Small Basic: http://smallbasic.com/ and without using any mathematical computation.
But bear with me, the speed is likely slow. Thanks!
Geometry is the branch of mathematics that concerned with the properties and relations of points, lines, surfaces, solids, and higher dimensional analogs.
We will need Microsoft Paint (MS. Paint) with Ruler and Gridlines actives.
The algorithm:
1. Draw any geometry shape you like inside MS. Paint. Here in this video we try the triangle first, then star and then rectangle.
2. Write down / records coordinates (the x-y pair of each line-segment--the start and the end of the line). If you want you may use the MS. Paint gridline in the left and top MS. Paint as your aid to write down the coordinates.
3. Open Small Basic editor, start typing line of code graphicswindow.drawline() into the editor as many as total lines of the shape you like to draw. For instance, triangle: 3 graphicswindow.drawline(), star: 5 graphicswindow.drawline(), etc.
4. Insert/type in each pair of coordinate pair into graphicswindow.drawline()
5. Last run (F5) the program
In more complex shape like star in this lesson, better that you give each of the line a number.
And last, If you can pour more creativity in number and variables you can do this: I call this pointreference method. I will discuss it in next video.