PencilCoder

Line Art!

Goals:

  • Use straight lines to draw geometric figures and make art

Coding Snippets:

  • coding snippets
  • Change the second argument of the pen function to a different number to change the pen width.
  • pu and pd stand for "pen up"and "pen down".
  • The fill function fills in the region traced by the turtle since the most recent call to the pen function.
  • For a list of some additional colors, see https://ref.pencilcode.net/turtle/colors.html

Math and Computer Concepts:

  • For this lesson, you will need to figure out the angles in shapes in order to know how many degrees to make the turtle turn. For example, consider an equilateral triangle (a triangle in which all three angles are the same). Because the interior angles of a triangle always add up to 180°, each angle in an equilateral triangle is 60°. However, if you make the turtle turn 60° after drawing each side, you will not draw a triangle, but this:
    BadAlgorithm
    To construct an equilateral triangle, you need to turn 120° each time. This angle has a special name: the supplement of 60°. It is computed as 180° − 60°.

Activities:

Save each of the following in a folder called LineArt.