Line Art!
Goals:
- Use straight lines to draw geometric figures and make art
Coding Snippets:
- Change the second argument of the pen function to a different number to change the pen width.
pu
andpd
stand for "pen up"and "pen down".- The
fill
function fills in the region traced by the turtle since the most recent call to thepen
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:
- In the activities that follow, for each shape, try to identify an underlying pattern between the number of sides and the size of the angle you need to turn. (Don't simply "guess and check"!)
Activities:
Save each of the following in a folder called LineArt.
- Complete a program which draws an equilateral Triangle.
- Create a Square. Fill in your square with a different color than you used for the edge.
- Draw a regular Pentagon.
- Create a regular Heptagon (seven sides!)
- There are various possible algorithms for drawing stars. Some only work for stars with an even or an odd number of points, while others work for any number of points. Draw a FivePointedStar and/or a SixPointedStar.
- Draw your Initials or Dice or a PeaceSign or a House.