Learning Math With

Total Page:16

File Type:pdf, Size:1020Kb

Learning Math With

LEARNING MATH WITH TERRAPIN LOGO: LESSONS 1-8

By Kathryn Shafer Updated fall 2017 www.terrapinlogo.com/logo/weblogo.html

1 Table of Contents Lesson 1: Line Segments

Purpose: This lesson introduces the basic commands and vocabulary used in Geometry. Essential Question: How do you tell someone how to move from one place to another place?

Question 1: If you want to walk from one location to a new location, you need two pieces of information. What are they?

Sample answers can be found at the end of this lesson. __ A line segment that starts at point S and ends at point T is written ST.

The turtle icon in the Terrapin Logo graphics window shown below “walked” 200 steps across the screen. He drew line segment ST. Note that on a computer screen the default turtle step is one pixel and this is really small. Also, the labels for the end points used in the text are not printed on the screen.

Figure 1.1

In the Listener Window, type the following commands Forward 200 Back 200 Note that Terrapin Logo is not case sensitive, so you can use upper or lower case letters.

Question 2: How long is line segment ST? ______Sample answers can be found at the end of this lesson.

3 LESSON 1 - TASK 1 You will work with a partner or in a group. Have a classmate tell you a direction to face and then tell you how many steps to walk (either forwards or backwards).

New Commands The home command sends the turtle to the home position with a 0 degree heading. The clear screen (or CS) command clears the graphics screen and sends the turtle to the home position. The clear text (or CT) command clears the listener window. The penup (or PU) command picks up the turtle’s pen so he does not leave a trail. The pendown (or PD) command puts the turtle’s pen back down so he can draw. The hideturtle (HT) and showturtle (ST) commands hide and show the turtle.

Question 3: Now, consider this. You are standing on the street and you need to go down the street. You know it is about 35 steps, but how do you know if you are going in the right direction?

New Commands The set heading command can be used to move the turtle in the directions associated with North, South, East and West. The unit of measurement for headings is degrees.

North = setheading 0 (or setheading 360) South = setheading 180 East = setheading 90 West = setheading 270

Abbreviations SETH is the abbreviation for setheading FD is the abbreviation for forward BK is the abbreviation for back

Example 1 Type the following commands in the listener window then look at figure 1.2. How did you do?

Setheading 0 fd 200 bk 200 setheading 90 fd 200 bk 200 setheading 180 fd 200 bk 200 setheading 270 fd 200 bk 200

Figure 1.2

In figure 1.2, the turtle started at a point, walked forward 200 steps and walked back 200 steps. The turtle walked North, East, South and West.

New Commands The turtle can be told to turn right or left. The unit of measurement for the amount of turn is degrees. Here are a few examples.

Right 90 will turn the turtle right 90 degrees. Left 45 will turn the turtle left 45 degrees.

Note that a complete set of directions for drawing a line segment will include both a direction in degrees and the number of pixels (length of the segment). When you get to middle school or high school you will call this a vector.

LESSON 1 - TASK 2 Practice creating line segments with different lengths pointing in different directions. Try each of the examples below. Recall that CS clears the screen and resets the turtle.

A. B. C. D. E. F. CS CS CS CS CS CS SETH 45 SETH 300 FD 100 FD 100 RT 45 FD 100 FD 75 BK 200 RT 90 LT 90 FD 60 RT 120 FD 100 FD 100 LT 90 FD 100 FD 60 HOME RT 90 FD 60

Example 2 5 In figure 1.3, the turtle started at a point, moved forward 200 steps and walked backwards 200 steps forming 8 segments instead of four. In order to have 8 segments drawn from the center point, the turtle turned 45 degrees after drawing each segment. The segments will be referred to as spokes in a wheel.

Figure 1.3

Both sets of Logo code in the table below will draw the graphic shown in figure 1.3. Test the code on your computer. Which set of commands makes more sense to you?

Logo code with the SETH command Logo code with the RIGHT command FD 100 FD 100 BK 100 BK 100 SETH 45 RT 45 FD 100 FD 100 BK 100 BK 100 SETH 90 RT 45 FD 100 FD 100 BK 100 BK 100 SETH 135 RT 45 FD 100 FD 100 BK 100 BK 100 SETH 180 RT 45 FD 100 FD 100 BK 100 BK 100 SETH 225 RT 45 FD 100 FD 100 BK 100 BK 100 SETH 270 RT 45 FD 100 FD 100 BK 100 BK 100 SETH 315 RT 45 FD 100 FD 100 BK 100 BK 100 LESSON 1 - TASK 3 Write the commands needed to draw the graphic shown in Figure 1.4 on a blank sheet of paper. Type the commands in Listener Window and compare your graphic to what is shown here.

Figure 1.4

Hint for figure 1.4 This wheel has 12 segments or spokes radiating from the center point. You should focus on the need to divide 360 degrees into 12 equal portions. 360/12 = 30 degrees. The headings will increase in increments of 30 degrees.

Orienteering is a sport that requires navigational skills to move from one location to another location. You might try to draw a map for how to walk from your classroom’s door to the front door of your school. Note that you will need to use headings (or turns) and steps on your map.

Question 1 Answer: If you said, “you need to know where to start and where to stop”, that would be correct. Let’s call the place where you start point S and the place where you stop point T.

S = starting point T = ending point (terminating point – think of the Terminator)

If you said, “you need to know how many steps”, you would be correct. If you were to connect point S to point T, with a line, it would be called a line segment because it has a beginning and an ending point.

If you said, “you need to know the direction”, you would be correct. Each time you move from one point to another point, you have moved in a certain direction.

7 Question 2 Answer: The turtle moved 200 steps, so the length is 200 pixels. You MUST include the word pixels because the turtle could have moved 200 inches or 200 centimeters, but he moved 200 steps or pixels. Pixels are the unit of measurement for length in Logo.

Question 3 Answer: You can see the street and you just know which direction to go. In order to communicate the direction to someone else, you need to tell him or her what heading to use.

Lesson One Project

Write the answer to these questions in your project journal BEFORE you test them out in Logo.

A. What happens if you use headings that are negative? B. What happens if you use headings that are greater than 360 degrees? C. What happens if you use a negative value for the pixels in the forward or backward commands? Lesson 2: Iteration

Purpose: This lesson introduces the idea of iteration. Iteration is the act of doing the same commands over and over again. Essential Question: How do you create a Logo design with the repeat command?

New Command: In the first lesson, you drew segments that looked like spokes of a wheel. You may have gotten really tired of typing the same set of commands over and over again. When this happens, it makes sense to use the repeat command. The repeat command needs 2 items, the number of repeats and a list of commands or “instructions” that need to be repeated.

For example, the command to walk forward 100 steps, backwards 100 steps, and then turn and do it again is written out below in words and in Logo code. repeat 2 [walk forward 100 steps walk backwards 100 steps turn right 90 degrees] repeat 2 [fd 100 bk 100 rt 90]

The general format is: repeat # [repeated instructions]

Caution: Do NOT use commas between any of the commands in the brackets.

LESSON 2 - TASK 1: Predict what will happen if you type the following commands into Logo. Then use Logo to confirm your prediction. Clear the graphics window between each problem by typing CS. You can clear the listener window by typing CT. You can move the cursor up to edit previous lines of code.

A. repeat 4 [fd 100 bk 100 right 90] B. repeat 8 [fd 100 bk 100 right 45] C. repeat 12 [fd 100 bk 100 right 30] D. repeat 10 [fd 100 bk 100 right 36]

LESSON 2 - TASK 2: There is a common pattern in each of the repeat commands above. Describe this pattern. Write a repeat command that will draw 20 evenly spaced spokes. See the end of this lesson for discussion of this task.

New Commands: The stamp command stamps the image of the turtle into the graphics window. The image will face in the same direction as the icon.

The lockshape command will prevent the turtle icon from rotating in a graphic. Lockshape can be used with the stamp command. CAUTION – the shape will be locked to the turtles most current heading! Use unlockshape to allow the turtle’s icon to rotate.

9 The turtletext (or tt) command takes a word or a list as input and writes it in upper case at the turtle’s current location. The text is orientated from left to right so you can read it.

In Terrapin Logo, the shapes panel or the setshape command changes the turtle’s icon to a different shape. Please read the Reference Manual or use the Help Menu to learn how to change the turtle’s shape.

Examples: The following examples combine the repeat command with the stamp, lockshape and turtle text commands. The train shape is also used. Type each set of commands into Logo and compare your graphic to what is shown in each figure.

A. repeat 10 [fd 100 stamp bk 100 right B. lockshape 36] repeat 4 [fd 50 stamp bk 50 right 90]

Figure 2.1 Figure 2.2 C. unlockshape D. ht repeat 10 [fd 100 stamp bk 100 right 36] repeat 8 [fd 50 tt "hi bk 50 rt 45]

Figure 2.3 Figure 2.4

In figure 2.3, the turtle icon was changed to a train icon (see your help menu for directions on how to change shapes). The train shape was unlocked. In figure 2.4, first I hid the turtle icon with the ht command. Then, I used the tt command to print the word HI at the end of each line segment. Note that you only use the double quote before the word HI.

LESSON 2 - TASK 3: In figure 2.5, the pen was pulled up (penup or pu command from Lesson One) so the line segments are not drawn in the graphic. The icon was changed to a bug and the shape is in the unlockshape setting. See if you can write the Logo code on your paper, then test it on your computer. Figure 2.6 used a repeat command, but is much more challenging. See if you can write the Logo code.

Figure 2.5 Figure 2.6

Lesson Two Project

Use the Repeat Command to write the Logo code for a graphic with a set number of spokes. You may decide on how many spokes you want to use and how long they should be. A few additional options (stamp, lockshape, or different shape icons) can be used to customize your project.

LESSON 2 - TASK 2: Discussion Note the structure of the repeat command – repeat x [fd # bk # right (360/x)]. Note that the values we have been using for x are FACTORS of 360. 360 is a multiple of 2, 3, 4, 5, 6, 8, 10, 12, 15, and 18.

11 Lesson 3: Introduction to Angles

Purpose: This lesson introduces the definition of an angle and the common ways in which we classify angles. Essential Questions: What are the different types of angles? What are a few of the common mistakes students make when discussing angles and their measure? Materials: Protractor and straightedge

Definition of an angle: Two distinct rays (or segments) with a common endpoint. Angle AVB is shown in figure 3.1

Figure 3.1

The first ray drawn by the turtle is called the initial ray. The second ray drawn by the turtle is called the terminal ray.

The point where the rays (or line segments) meet is the common endpoint for the angle. In figure 3.1, the vertex is labeled with the letter V. Always use upper case letters to label points!

The angle measurement is the number of degrees between these two rays. Some people will call this the magnitude or the amount of turn.

The correct notation for writing angle measure is as follows:

m(∠AVB) = 50° or m(∠V) = 50°

Use a protractor to verify that the angle shown in figure 3.1 is 50 degrees. If necessary, you may extend the segments with your straight edge tool. Angles are classified by type (or have specific names) and are measured in degrees with a protractor. ● An angle equal to 1/4 turn (90° or Pi / 2 radians) is called a right angle. ● Angles equal to 1/2 turn (180° or two right angles) are called straight angles. ● Angles that are not right angles or multiples of a right angle are called oblique angles. ● Angles that measure between 0° and 90° are called acute angles ("acute" meaning "sharp"). ● Angles that measure between 90° and 180° (between a right angle and a straight angle) are called obtuse angles ("obtuse" meaning "blunt"). ● Angles that measure between 180° and 360° (between a straight angle and full turn) are called reflex angles.

Example 1: Turning the turtle right (or left) will draw the graphic shown in figure 3.2. Note that the angle measure looks different depending on which way the turtle turns. A right turn moves the turtle in a clockwise direction. A left turn moves the turtle counterclockwise. Recall the stamp command from Lesson One.

Turn Right 120° Turn Left 240° The Result is the Same! cs cs seth 0 seth 0 fd 100 fd 100 stamp stamp bk 100 bk 100 rt 120 lt 240 fd 100 fd 100 stamp stamp bk 100 bk 100 Figure 3.2

The 240° angle shown in figure 3.2 is called a reflex angle.

LESSON 3 - TASK 1: A. Draw a 60° degree angle on your paper with a protractor and straight edge. B. Write the logo code for the 60° angle using a right turn, and then a new set of code for a left turn, as illustrated in Example 1. C. What is the relationship between the angle measure used in the right turn and the angle measure used in the left turn.

Lesson 3 – Task 2: Repeat the directions from Task 1 for the following angles: A. A right angle B. An obtuse angle (you may choose the angle measure)

Example 2:

13 You can also draw an angle greater than 360 degrees. The following examples show two different ways to draw angle AVB. In figure 3.3, the points A, V and B were printed by using the Turtle Talk or TT command. Note that you only need the double quote mark before the letter. Recall that Logo is not case sensitive so capital letters may be used in the code.

45 degree angle 405 degree angle Logo Graphic CS CS SETH 0 SETH 0 FD 100 TT "A FD 100 TT "A BK 100 TT "V BK 100 TT "V RT 45 RT 405 FD 100 TT "B FD 100 TT "B BK 100 BK 100 HT HT

Figure 3.3

LESSON 3 - TASK 3: A. Draw a 90° degree angle on your paper. B. Write the Logo code for a 90° angle using a measure greater than 360 degrees. Start with a zero degree heading and turn clockwise. C. Test the Logo code on your computer.

Common Mistake Number One: ● You may NOT have a zero degree angle. Why not? ● Is the initial ray different from the terminal ray? ● How many distinct segments did you draw?

The word distinct has a very specific meaning in mathematics. Another word we could have used is unique. Are the two segments unique (different)?

Common Mistake Number Two: ● You should not use the words small or large to describe angles. Why?

Lesson Three Project

A. Create a clever song, rap, or poster page in your project notebook with the title NO ZERO ANGLES ALLOWED. Include a clear description and picture to illustrate why this particular angle is impossible to make. B. Draw an angle with 1500 degrees on paper and then on your computer with Logo. C. Summarize the new vocabulary terms in this lesson. Lesson 4: Angle Pairs and the Coordinate Grid

Purpose: This lesson introduces a classification system for pairs of angles. You will also learn about the coordinate plane and how to position the turtle in the plane. Essential Questions: How can you use Logo to position the turtle in the coordinate plane? How are angles related to each other? The Coordinate Grid: The connection between geometry and algebra is the coordinate grid. A grid can be shown on a plane. An ordered pair will represent points in the plane.

A plane has two dimensions, which is why points are represented by two values. The first coordinate is called the abscissa. A change in the abscissa’s value moves a point left or right. The second coordinate is called the ordinate. A change in the ordinate’s value moves a point up or down. It is important to use the correct order (abscissa, ordinate). The ordered pair (0,0) is called the origin. In Logo, the turtle’s home location is the origin.

New Commands: The grid in the graphics window can be turned on by using the command gridon and can be turned off by typing gridoff in the listener window.

The turtle command setxy [x y] moves the turtle to the (x, y) position in the coordinate plane. Note that you do not need a comma in the setxy Logo command. Figure 4.1 shows a grid in the graphics window. Segments were drawn from the origin to points in each corner of the grid. Recall that the ordered pair moves left or right the amount designated by the first coordinate (x), and moves up or down the amount designated by the second coordinate (y). There are four quadrants in the coordinate plane.

Logo code Logo graphic

Gridon setxy [300 200] home setxy [-300 200] home setxy [-300 -200] home setxy [300 -200] home

Figure 4.1 15 LESSON 4 - TASK 1: Predict the quadrant for the given coordinates in the chart. Check your work using Logo.

Location Quadrant Location Quadrant setxy [-100 -100] setxy [300 -50] setxy [92 82] setxy [-50 -50]

Adjacent Angles: Adjacent Angles are positioned next to each other. They share a common ray between them and the respective angles’ interiors do not overlap. In figure 4.2 ∠POQ is adjacent to ∠QOR. Note that adjacent angles MUST share a common vertex. An alternate definition is: Angles that share a common vertex and edge but do not share any interior points are called adjacent angles.

Figure 4.3 shows an example of two angles that are not adjacent (nonadjacent) to each other because they do not share a common ray (or segment). Adjacent Angles Non-adjancent Angles

Figure 4.2 (GSP*) Figure 4.3 *The Geometer’s Sketchpad was used to design a few of the graphics shown in this lesson. The program was used to show point labels and angle measures.

Vertical Angles: Two angles opposite each other, formed by two intersecting straight lines that form an X- like shape, are called vertical angles or opposite angles or vertically opposite angles. These angles are equal in measure. See figure 4.1 for an example of two pairs of vertical angles.

An alternate definition is: When two lines intersect, the non-adjacent angles are called vertical angles. These angles share a vertex and are equal in measure.

Common Mistake Many of my students have created graphics similar to what is shown in figure 4.4. These examples are not vertical angles! What part of the definition did they not pay attention to?

Figure 4.4 (GSP)

Complementary and Supplementary Angles: The most common classification system for angle pairs is determined by their measures.

Two angles that sum to one right angle (90°) are called complementary angles. The complement of an angle of x degrees is an angle of (90 - x) degrees (see figure 4.5).

Supplementary angles are pairs of angles that add up to 180 degrees. Thus, the supplement of an angle of x degrees is an angle of (180 - x) degrees (see figure 4.6).

Complementary angles Supplementary angles

Figure 4.5 Figure 4.6

Common Mistake A common misunderstanding is that complementary (or supplementary) angles have to be adjacent. Note that the Wikipedia graphics, shown in figures 4.7 and 4.8, support this common misconception.

17 Figure 4.7 Figure 4.8 Graphic from Wikipedia, July 2012 Graphic from Wikipedia, June 2012

Linear Pair One final definition is necessary. Adjacent supplementary angles are angles that are adjacent and supplementary. They form a linear pair. Figure 4.9 shows four linear pairs (each semicircle or half-circle runs through two adjacent supplementary angles).

Figure 4.9

LESSON 4 - TASK 2: Write the Logo code for the graphics shown in the three figures below. Check your work with the Logo code shown on the next page.

Adjacent Acute Vertical Angles Nonadjacent Angles complementary angles

Figure 4.10 Figure 4.11 Figure 4.12

Adjacent Acute Angles Vertical Angles Nonadjacent complementary angles FD 100 BK 100 PU HOME RT 45 SETH 160 FD 100 BK 100 FD 100 BK 100 SETXY [-50 100] RT 30 RT 55 PD FD 100 BK 100 FD 100 BK 100 FD 200 PU SETXY [0 -100] PU PD SETH 10 FD 100 BK 100 SETXY [-20 -122] LT 60 PD FD 100 BK 100 FD 200 HT

Lesson Four Project

A. Create a vocabulary list that defines and illustrates how angles can be related to each other angle. Use Logo as necessary. B. Summarize how the coordinate grid can be used in the Logo environment.

19 Lesson 5: Regular Polygons

Purpose: This lesson introduces regular polygons and the location of an exterior angle. Essential Questions: What does it mean for a polygon to be regular and why is this word so important? What is true about the sum of the exterior angles of any polygon?

Polygons are classified by type (or have specific names). Using the Internet as a source of information is an exciting way to incorporate another technology tool to support student learning. Students could be challenged to find three definitions for a term. They can compare and contrast the definitions pointing out differences in word choices. The fact that students will use the Internet to do their homework requires the classroom teacher to know which sources are providing reliable information and which ones are suspect. Two examples are shown here (retrieved from Wikipedia, May 2011).

In geometry, a polygon is traditionally a plane figure that is bounded by a closed path or circuit, composed of a finite sequence of line segments. These segments are called its edges or sides, and the points where two edges meet are the polygon's vertices or corners. The interior of the polygon is sometimes called its body.

Polygons can be classified by noticing different properties about the sides or the interior angles. Most people recall that regular polygons are equilateral and equiangular. Another classification of polygons looks at if the sides intersect or not.

A regular polygon contains sides with the same side measurement AND interior angle measurement. An irregular polygon does not restrict the side or angle measurements. If the term “regular” does not precede the term “polygon” the reader can assume that the shape could be either regular or irregular.

Simple Regular Simple Pentagon Complex Polygon Hexagon

Figure 5.1 Figure 5.2 Figure 5.3

A simple polygon is a finite sequence of connected line segments called sides that do not cross each other and share the same plane. The shapes shown in figure 5.1 and figure 5.2 are examples of simple polygons.

A complex polygon has sides that intersect each other. The eight-sided star polygon shown in figure 5.3 is an example of a complex polygon. Convex and concave polygons are additional terms used to classify type of polygons. Research the definitions of these vocabulary terms. Before reading ahead, think about how you would program the turtle to draw a square or an equilateral triangle.

For ease of discussion, we will start the instructions for the turtle–the Logo code–from the turtle’s location as shown in figures 5.4 and 5.5 below. We will move the turtle in a clockwise direction (right turns) unless stated otherwise.

Note that the exterior angles are shown to help you think about how much the turtle has Figure 5.4 Figure 5.5 to turn.

Open your logo program and type in the Logo code (next to figure 5.6) for a square. Next, instruct the turtle to draw the equilateral triangle shown in figure 5.7. Try to do this without looking at the example code shown in the table below.

It is easier to create the square because the amount of turn at the corner is determined by the exterior angle; in a square this is 90 degrees. In the equilateral triangle, the exterior angle is 180 – 60 or 120 degrees. Why?

Square Code: Triangle Code: FD 100 RT 90 RT 90 FD 100 FD 100 RT 120 RT 90 FD 100 FD 100 RT 120 RT 90 FD 100 FD 100 RT 120 RT 90 or or RT 90 Repeat 3 [fd Repeat 4 [fd 100 rt Figure 5.6 100 rt 120] Figure 5.7 90]

LESSON 5 - TASK 1: Use the Terrapin Logo program to create the following shapes. For each of the shapes, print out your graphics screen and copy the corresponding code on the page (you may copy and paste the code into a Microsoft word file and print using a 2-column setting). A side length of 100 steps is suggested. Try to complete this exercise before reading ahead to check your work.

21 A. Simple regular pentagon B. Simple regular octagon C. Simple regular 12-gon

Polygon Names: Many polygons have specific names, which depend on the number of sides. A triangle can also be called a trigon. The quadrilateral is also called the tetragon. Some of the following names should be familiar, but others may be new.

Name # sides Name # sides Name # sides Pentagon 5 Nonagon 9 Triskaidecagon 13 Hexagon 6 Decagon 10 Terakaidecagon 14 Heptagon or 7 Hendecagon or 11 Pentadecagon 15 Septagon Undecagon Octagon 8 Dodecagon 12 Hexakaidecagon 16

The website http://www.mathsisfun.com/geometry/polygons.html lists names for the polygons with up to 20 sides and the multiples of 10 to 100. Once the number of sides of a polygon becomes greater than 10 it is common to name the polygon with the number of sides attached to the suffix “gon.” For example, a dodecagon with 12 sides is commonly called a 12-gon.

There is a unique relationship between the number of sides and the amount of turn the turtle needs to make at each corner of the polygon. Make a conjecture about the exterior angles used in the hexagon shown in figure 5.8 and the heptagon shown in figure 5.9.

Hexagon (with exterior angles shown) Heptagon (with exterior angles shown) Figure 5.8 Figure 5.9

One conjecture would be that the turtle has to travel around the shape and end up where he started. This is similar to traveling a circular path, so one trip would require a total turn of 360 degrees. In the hexagon, the turtle is turning 6 times of equal amounts so each turn is 360/6 or 60 degrees. In the heptagon the turtle turns 7 times for 360/7 or 51.4 degrees. Since the action of drawing the side and turning is repeated, the Logo repeat command is quite efficient.

The code for a hexagon is: Repeat 6 [fd 100 rt 60]

The code for a heptagon is: Repeat 7 [fd 100 rt 51.4]

If you replace the number of sides with the variable s, we can write a Logo code template for any regular polygon. We have stumbled upon what is often called the “Rule of 360”:

Repeat s [fd x rt (360/s)]

LESSON 5 - TASK 2: A. Write the Logo code for a regular dodecagon with side length 20 steps.

B. Write the Logo code for a regular 20-gon with side length 14 steps.

Common Mistake: If a teacher asks students to draw a polygon with 5 sides, can she assume that students will draw a regular pentagon? Often the sketched pentagon will look like a house. Unless there is a restriction on the side length or the angle measures, this is perfectly acceptable.

Lesson Five Project

Use the repeat command to make three simple regular polygons and one complex regular polygon that are different from the examples shown in this lesson. A complex polygon is shown in figure 5.3.

23 Lesson 6: Logo Circles

Purpose: This lesson introduces the relationship between a polygon and a circle to draw “circles” and “arcs” in the Logo workspace. Essential Question: How can Logo be used to draw “circles” and arcs of given dimensions (circumference or diameter). What is the difference between arc measure and arc length?

In the Logo programming language, the turtle can move in two directions and can turn right or left. Is it possible for the turtle to draw what appears to be a circle? You may have noticed that a turtle step (pixel) of 1 unit is very small and can be thought of as a single point.

Pretend you are the turtle and stand in a large room, how would you “walk” a circle? Go ahead and try this! You probably took one step, turned a very small amount, took another step, and turned a very small amount (in the same direction) until you reached your starting point. Since the turtle steps are so small, a polygon with over 100 sides will appear to look like a circle. For discussion purposes we will call this shape a regular polygon or a Logo “circle” instead of a 100-gon. The first two examples will draw “circles” and the third example will draw a semi-circle.

Example 1: Mathematics Logo ‘Circle’ The larger circle in Figure 6.1 was drawn using repeat 360 [fd 1 rt 1]. This repeat command will result in a 360-sided polygon, because the turtled turned 1 degree 360 times.

An examination of the repeat command tells me that the circumference is (360 * 1) or 360 turtle steps

The circumference formula is C = Pi * d, so the diameter of the larger circle is found by solving for d. 360 = 3.14 * d so d = 360 / Pi = 114.6 steps

Figure 6.1

The smaller circle in figure 6.1 was drawn using the repeat 180 [fd 1 rt 2] command. This repeat command will also result in a 360-sided polygon, because the turtle turned 2 degrees 180 times. The Circumference of the smaller circle is C = Pi * d. d = 180 / Pi = 57.3 turtle steps

The astute reader will notice that the diameters for the two circles have a ratio of 2 to 1. A common problem found in school mathematics is to find the ratio of the area of the two circles. While these lessons have not included problems on area, this is a great opportunity to look at the ratio of similar circles. Will the ratio of the areas also be 2:1?

Area of large circle = Pi* r2 Area of small circler = Pi* r2 Area = 3.14 * (57.3)2 = 10,396.5 square turtle Area = 3.14 * (28.65)2 = 2,577.4 square turtle steps steps

If we divide the larger area by the smaller area, the result is approximately 4. This means that the area of the large circle is four times as large as the small circle. The relationship for the areas is represented by a ratio of 4:1.

Example 2: Mathematics Logo Graphic The semi-circle in figure 6.2 was drawn using repeat 180 [fd 2 rt 1].

This repeat command results in half of a circle or a semicircle, because the turtled turned 1 degree 180 times.

The arc shown in figure 6.2 has an arc measure of 180 degrees. Figure 6.2 Analysis An examination of the repeat command tells me that the circumference of the full circle is (180*2) or 360 turtle steps. Since this is semicircle, we have an arc length of 180 turtle steps. The segment length across the ends of the semicircle is the diameter of the full circle. 360 = 3.14 * d so d = 360 / Pi = 114.6 steps This is important if I want to draw the radius or the diameter.

Example 3: Mathematics Graphic The real challenge is when you are given the dimensions first and need to write the Logo code. For example what if you want to code a 90- degree arc for a circle that has a radius of 70 steps (see figure 6.3). Figure 6.3 Analysis First, I am going to determine the amount of turn. The easiest way would be to set up the repeat template as follows: Repeat 90 [fd ? rt 1]

The next step is to determine the circumference of the full circle. Since the radius is 70 steps the diameter is 140 steps. The circumference would be (140*Pi) or 439.6 steps. The problem requires a quarter circle. This means the Circumference needs to be divided by 4 to determine the number of turtle steps (arc length). 439.6 / 4 = 109.9 steps

The last step is to calculate the missing value in the forward command: 90*? = 109.9 so ? = 1.22 steps The result will be Repeat 90 [fd 1.22 rt 1]

25 Summary: Note that when small turns or small forward commands are used, the polygon will appear as a circle. If we use the expression repeat x [fd y rt z] the circumference of the Logo circle equals (x * y), so the diameter would be (x * y)/Pi, because C = d * Pi.

New Command: stampoval x y draws an oval around the turtle. Note that when you use the stamp command, the turtle is located at the center of the stamp.

Try stampoval 50 100 or stampoval 100 100 in the listener window. The first input value x, is the horizontal radius across the oval and the second value, y is the vertical radius. If x = y then this command will stamp a circle.

Figure 6.4

LESSON 6 - TASK 1: A. Complete the Logo code to draw a circle with a diameter of 36 steps. Repeat 360 [fd ? rt 1]

B. Complete the Logo code for an arc measure of 90 degrees with a radius of 50 steps. Repeat 45 [fd ? rt 2]

C. Write the code for a Logo circle that has a diameter of 200 steps. D. Write the code for a Logo circle with a circumference of 200 steps. E. Write the Logo code for a 90-degree arc (quarter of a circle) that has arc length 100 steps (pixels).

Lesson Six Project

Use your knowledge of the coordinate plane to create a picture with a few circles, semicircles and arcs.

Suggestions include a smiley face or a snowman. Example Project

27 Lesson 7: The Pythagorean Theorem and Triples

Purpose: This lesson introduces the Pythagorean Theorem. A related concept is the Pythagorean Triple. Essential Questions: What is the Pythagorean Theorem and how can it be used to find a missing side length in right triangles?

The Pythagorean Theorem states that if you are given a right triangle, the sum of the squares of the legs’ lengths will equal the square of the length of the hypotenuse.

The converse of the Pythagorean Theorem states that if the sum of the squares of the two shorter sides of a given triangle equals the square of the longest side, then the triangle is a right triangle.

This biconditional theorem is one of the most powerful theorems in mathematics, because it allows us to calculate a missing side length in any right triangle. Each of the shorter sides of a triangle are called legs and the longest side is called the hypotenuse. The proof of the theorem is beyond the scope of this lesson.

Solve for missing side lengths: All rectangles can be decomposed into two right triangles. The consecutive sides (do not call them adjacent sides) are the legs and the diagonal (connect the opposite vertices) is the hypotenuse. The hypotenuse is shared between the two right triangles. The reason that this works is because all of the angles in a rectangle are right angles.

Note that in this lesson, I used the setxy command in the coordinate plane to draw the diagonal (hypotenuse) in the Logo rectangles. Example 1: Figure 7.1 shows rectangle ABCD with dimensions 3 units by 4 units. Figure 7.2 shows a rectangle created in Logo using the dimensions 30 by 40 pixels. A scale factor of ten units was used to create the Logo triangle because 3 turtle steps would not show up on the screen.

The setxy command connects the point (0,0) to the point (40, 30).

The essential question is, what is the length of the diagonal (segment DB) in these rectangles?

Figure 7.2 Figure 7.3 Logo Code for figure 7.2 Logo Code for figure 7.3

fd 30 rt 90 fd 40 rt 90 fd 30 rt 90 fd 40 rt 90 fd 30 fd 30 rt 90 fd 40 rt 90 fd 40 Figure 7.1 (GSP) setxy [40 30]

In figure 7.1, the give side lengths are 3 units by 4 In figure 7.2, the give sides are 30 pixels by 40 units. According to the Pythagorean theorem, the pixels. According to the Pythagorean theorem, the hypotenuse squared would equal the sum of the hypotenuse squared would equal the sum of the squares of 3 and 4. squares of 30 and 40. Substitute the measure of each leg into the Substitute the measure of each leg into the equation equation and solve. and solve. leg2 + leg2 = hypotenuse2 leg2 + leg2 = hypotenuse2 32 + 42 = hypotenuse2 302 + 402 = hypotenuse2 9 + 16 = hypotenuse2 900 + 1600 = hypotenuse2 25 = hypotenuse2 2500 = hypotenuse2 the square root of 25 = the hypotenuse the square root of 2500 = the hypotenuse 5 units = hypotenuse 50 pixels = hypotenuse The caculations indicate that the distance The caculations indicate that the distance from (0,0) to (4, 3) is 5 units. from (0,0) to (40, 30) is 50 pixels.

Very Important Note: The results of a square root function would be both a positive and a negative value. Because geometry problems are finding length, length has to be positive. Thus, the negative value is ignored.

29 Example 2: Figure 7.4 shows a rectangle created in Logo using the dimensions 50 by 120 pixels. The setxy command connects the point (0, 0) to the point (120, 50). Find the length of the diagonal (hypotenuse).

Logo Code, Graphic, and Mathematics fd 50 rt 90 fd 120 rt 90 leg2 + leg2 = hypotenuse2 fd 50 rt 90 fd 120 setxy [120 50] 502 + 1202 = hypotenuse 2500 + 14400 = hypotenuse2 16900 = hypotenuse2 SQRT (16900) = hypotenuse 130 pixels = hypotenuse The caculations indicate that the distance Figure 7.4 from (0,0) to (120, 50) is approximately 130 pixels.

Note that the computation in Example 2 used the abbreviation SQRT for “square root.” This is common when writing equations in computer code. Note that in Logo, you need to use parentheses to indicate the value you are taking the square root of. The square root of 160 and the square root of 100 results in an integer (no decimals), but the square root of 120 is an irrational number.

SQRT (169) = 13 SQRT (100) = 10 SQRT (120) ≈ 1.4

Caution: The result of the square root function can be an irrational number. In this lesson (and the rest of this book), round irrational numbers to the tenths place. I will use the “approximately equal to” symbol ≈ to indicate that the number has been rounded. Example 3: Figure 7.5 shows a triangle created in Logo using the dimensions 30 by 180 pixels. The setxy command connects the point (0,0) to the point (180, 30). Find the length of the hypotenuse. Note that the hypotenuse is not an integer! The equations for this example use the hypotenuse on the left side of the equal sign. This is perfectly okay.

Logo Code, Graphics, and Mathematics fd 30 rt 90 fd 180 home hypotenuse2 = 302 + 1802 hypotenuse2 = 900 + 32400 hypotenuse2 = 33300 hypotenuse2 = square root of 33300 hypotenuse ≈ 182.5 pixels or turtle steps

The caculations indicate that the distance from (0,0) to (180, 30) is approximately Figure 7.5 183 pixels.

To check your answer, calculate 182.52 - 302 = 33306.25 - 900 =

Lesson 7 – Task 1: Use a calculator to find the missing side lengths for the following triangles. Round calculations to the nearest tenth. The right 90 command indicates a right triangle was drawn.

A. Sketch the graphic on your B. Sketch the graphic on your paper and calculate paper and calculate the length of the length of the missing hypotenuse. the missing hypotenuse. fd 60 cs rt 90 rt 30 fd 100 fd 82.5 rt 90 bk 82.5 home lt 90 fd 100 bk 100 Figure 7.7 Figure 7.6 ht

*In Lesson #9, you will learn how to compute the measures of the acute angles in a right triangle by using the sine function.

Example 4: What if we know the measures of the hypotenuse and one of the legs in a given right triangle? Can we work backwards to find the missing leg length? Yes! The

31 examples shown in the table below illustrate the computation used to find the measure of the missing leg.

A. Find the length of segment y B. Find the length of segment w

Figure 7.8 Figure 7.9 Computation Computation y2 + 1602 = 1902 w2 + 1502 = 1832 y2 = 1902 - 1602 w2 = 1832 - 1502 y2 = 36100 - 25600 w2 = 33489 - 22500 y2 = 10500 w = SQRT (10989) y = SQRT (10500) w ≈ 104.8 pixels y ≈ 102.5 pixels

LESSON 7 - TASK 2: Use a calculator to find the missing side lengths for the following triangles. Remember to round irrational numbers to the nearest tenth of a pixel.

A. Find the length of segment x. B. Find the length of segment AC.

Figure 7.10 Figure 7.11

Pythagorean Triples: The converse of the Pythagorean theorem states that if the sum of the squares of the two shorter sides of a given triangle equals the square of the longest side, then the triangle is a right triangle. A Pythagorean Triple is a set of three positive integer values that satisfy the converse of the Pythagorean theorem. We will begin our discussion with the triple 3-4-5. Note the positive integers are the set of numbers {1, 2, 3, … }.

The 3-4-5 triple is the one that most people recognize, because if you square the two smaller values (the 3 and the 4) and add the squares, you get 9 +16, which is 25.

32 + 42 = 52 9 + 16 = 25

The calculation confirms that IF the sides are 3-4-5, THEN the triangle is a right triangle.

Since 3 turtle steps are very small in Logo, you can use a similar triangle with larger dimensions. The common factor in 30, 40, and 50 is ten. Multiply each side length in the 3-4-5 triangle by ten and you get 30-40-50 as the new side lengths (see Example 1).

The result of using a scale factor of 100 with the 3-4-5 triple, would be a similar triangle with side dimensions 300, 400 and 500. The calculation below verifies the relationship. 3002 + 4002 = 5002 90000 + 160000 = 250000

LESSON 7 - TASK 3: A. Confirm that the set of side lengths 7, 24, and 25 is a Pythagorean triple (show work).

B. Determine if the set of side lengths 5, 13 and 12 is a right triangle.

C. Do you think that there are an infinite number of Pythagorean Triples? Explain.

Common Mistake Number One: As you can probably guess, the most common error happens when people incorrectly substitute side lengths into the equation. For example, in figure 7.8 a person might write 1902 + 1602 = h2. This would produce a leg that is longer than the hypotenuse. Always sketch your shape and ask yourself if the side lengths you are finding make sense in the equation you are using.

Common Mistake Number Two: Some people try to use this theorem with ANY triangle. Can you explain (demonstrate) why this is a silly thing to do?

33 Lesson Seven Project

A. Sketch a rectangle with dimensions of your choice. Draw a diagonal. Use the Pythagorean theorem to find the length of the diagonal. B. Write and test your Logo code on the computer. Save a copy of the code and the graphic. C. Create a right angle like the one shown in Task 1.B. In your shape, the right angle should be tilted. Compute the missing hypotenuse for the right triangle you created. Extension: Every rectangle has two diagonals that cross each other. Are the diagonals of a rectangle congruent (have equal measures)? Why or why not? Find the perimeter and area of the triangles you created. What is the relationship between the area of a rectangle and the area of the decomposed triangles inside the rectangle?

Review Challenge: Each side measure for the regular polygons in the shape shown here is 50 turtle steps. Write and test the Logo code for this drawing. Lesson 8: Color and Procedures

Purpose: This lesson introduces Logo color commands, sub-procedures, and calling procedures. Essential Questions: How can you add color to a Logo design? How can you store Logo code so it is saved from one work session to the next work session?

Color: There are a number of Logo commands that can be used to change the boring black and white Logo environment into a colorful and pleasing environment. The fist half of this lesson will provide examples of the various color commands and individual color codes. I strongly recommend that you investigate (play) with these commands on your computer. The second half of this lesson will illustrate how to write the Logo code for a house design in a way that breaks down the scene into small chunks. These chunks of code will be placed in sub-procedures. The main “calling” procedure, that puts all the chunks together, will be called HOUSE.

New Commands: In Logo, the pen color can be modified with the SETPC command followed by a single integer, a text command, or an RBG sequence. The background color can be changed using the SETBG command. The interior of a shape can be changed using the FILL command. The fill command will use the turtle’s current pen color. If the pen color is red and you type FILL, the interior of the shape will be red. The default pen color is black. To return the turtle to black, type SETPC 0.

It is important to use the penup (pu) and pendown (pd) commands when you do not want to have a line segment or a trail in the graphic. Also, recall that the pen width can be changed using the SETW command with an integer value between 1 and 99.

Command Result SETPC 4 Changes the pen color to red. SETPC Changes the pen color to yellow. Note there is a space after the “YELLOW setpc command and you must type the double quote symbol. SETPC [0 255 0] The RGB values set the pen color to lime green. The three integers indicate the amount of red, green and blue to be mixed. SETBG 6 Changes the background color to brown.

Color Commands – Numbers and Names 1. Blue 9. LightBlue 2. Green 10. LightGreen 3. Cyan 11. LightCyan 4. Red 12. LightRed 5. Violet 13. Magenta 6. Brown 14. Yellow 7. LightGrey 15. White 8. DarkGrey

35 These color numbers and names are typical to the Logo environment, but specific programs might vary in color shade and the syntax (how you type the command). Note that the RGB values are standardized across all computer graphic environments. For additional examples and information on color commands, refer to the help menu of the Logo program you are using.

To color the interior of a shape, you must do the following: 1. Move the turtle to a location inside the shape (I suggest a pen up, move, pen down sequence). 2. Change the pen color (if desired). 3. Type FILL. You will probably not see the turtle icon, because it is the same color as the shape.

Example 1: Type the following commands into the Listener Window and compare your work to figure 8.1.

CS PD SETPC 5 SETWIDTH 5 REPEAT 4 [fd 100 rt 90] PU RT 45 FD 10 SETPC "red PD FILL SETBG "green PU Figure 8.1 Red Square

Example 2: Type the following commands into the Listener Window and compare your work to figure 8.2.

CS PD SETBG 1 SETPC 0 SETW 10 REPEAT 6 [rt 60 fd 100] PU SETXY [15 0] SETPC [255 222 0] PD FILL Figure 8.2 Yellow Hexagon Lesson Eight – Task 1:

In most every Logo program, you can open a procedure editor by typing the words TO NAME in the listener window. Follow the steps below to create programs for Figures 8.1 and 8.2.

Figure 8.1 Red Square Figure 8.2 Yellow Hexagon

Figure 8.1 Red Square Program Type To redsquare in the listener window. Then type (or paste) the Logo code from Example 1 into the Program Editor. Click "Define". To run the program, type redsquare in the listener window.

Figure 8.2 Yellow Hexagon Program Type To yellowhex in the listener window. Type (or paste) the Logo code from Example 2 into the Program Editor. Click "Define". To run the program, type yellowhex into the listener window. Note that the program name is not case sensitive.

The best way to learn about how procedures work is to reproduce a few examples. Figure 8.3 shows the drawing of a house. There are three short procedures (chunks) of the house design: FRAME, DOOR and WIND. The main calling procedure is HOUSE. Notice that the only commands in the HOUSE procedure are the subprocedures.

37 Figure 8.3 Penthouse Figure 8.4 Frame

Steps: 1. Type To Frame in the Program Editor. 2. Type the commands shown here in the procedure window (except for End) and click on Define. Do not type the word End; this command will appear by default after the procedure is defined. 3. Type Frame in the Listener Window and the frame should appear in the Graphics Window as shown in figure 8.4.

TO FRAME CS SETW 3 PU SETPC "RED SETH 90 SETXY [0 0] PD REPEAT 5 [FD 60 LT 360 / 5] PU END

Continue defining and running the subprocedures DOOR and WIND.

TO DOOR SETW 3 PU SETPC 0 SETH 0 SETXY [25 0] PD REPEAT 2 [FD 20 RT 90 FD 10 RT 90] PU SETXY [27 5] PD FILL END Caution the word Window is an existing Logo command and it cannot be used as the name for a procedure. I used Wind instead.

TO WIND SETW 4 SETPC [0 0 255] PU SETH 90 SETXY [0 40] PD REPEAT 3 [FD 20 LT 120] SETH 90 PU SETXY [40 40] PD REPEAT 3 [FD 20 LT 120] PU END

After typing and running each of these subprocedures, create the House procedure. Then, run the House procedure from the listener window.

TO HOUSE FRAME DOOR WIND HT END

When you are done, it is time to save your work as a file. 1. Select File | Save | Workspace as to store the file with your procedures. 2. Select File | Load into Workspace to open the saved file.

Caution: Please save your file and quit Logo when you are done with the House procedures above. Open Logo up and begin a new file when completing the following task (because the procedures will have similar names). In some Logo programs you will need to name the task with a different file name.

LESSON 8 - TASK 2: Read through the sub-procedures and the main calling procedure for the house design shown in figure 8.5 (without the grass). Type all of the procedures into Logo and compare the graphic to your results. Save your Logo workspace.

39 Figure 8.5 House with sun and tree

To Frame To Door To Wind TO FRAME TO DOOR TO WIND PU SETPC 0 SETH PU PU SETPC 0 SETH 0 0 SETPC 0 SETXY [-30 10] SETXY [-60 -100] SETXY [10 -100] PD PD SETH 0 REPEAT 2 [FD 60 RT 90 FD 40 RT FD 200 RT 45 PD 90] FD (90 * SQRT (2)) FD 90 RT 90 PU RT 90 FD 40 RT 90 SETXY [50 10] FD (90 * SQRT (2)) FD 90 PD RT 135 PU SETXY [30 REPEAT 2 [FD 60 RT 90 FD 40 RT FD 180 BK 180 -90] 90] LT 90 SETPC 13 PU SETPC 13 SETXY [-20 15] FD 200 PD PD FILL RT 90 FILL PU SETXY [60 15] FD 180 PD FILL PU PU SETXY [-30 -50] SETXY [90 110] PD PD SETPC "YELLOW SETPC "BROWN FILL FILL

To Tree To Treetop To Sun TO TREE TO TREETOP TO SUN PU PU PU SETH 0 SETPC "GREEN SETPC "RED SETPC "BROWN SETH 90 SETH 0 SETXY [175 -100] SETXY [170 -20] SETXY [-120 110] PD PD PD FD 80 RT 90 FD 10 RT REPEAT 8 [FD 20 LT REPEAT 360 [FD 0.61 LT 90 45] 1] FD 80 RT 90 FD 10 PU PU PU SETXY [175 -10] SETXY [-125 110] SETXY [180 -90] PD FILL PD FILL PD FILL HT

To Myhouse (blue background)

TO MYHOUSE CS SETPC 0 SETWIDTH 3 FRAME DOOR WIND TREE TREETOP SUN SETBG [140 245 245]

Addendum: Writing the Logo code for the house is an example of computer programming. No matter if you are new to programming, or a pro, you will make mistakes. When you make a mistake, you will need to debug your program (procedures) to find where the error is.

1. Experienced programmers write code in small chunks so that the error will be isolated. 2. Experienced programmers write code with paper and pencil (offline) as opposed to using a “guess and check strategy” while looking at the computer screen. 3. Experienced programmers use different languages for different purposes. For example, html, Java, C++ and Flash are languages used by web designers. 4. Experienced programmers write code that other people can read. You can add comments into a Logo program that will not be read by the turtle. 5. Logo is a basic but powerful programming language created in 1967 by Seymour Papert at MIT. http://en.wikipedia.org/wiki/Seymour_Papert http://en.wikipedia.org/wiki/Logo_%28programming_language%29

41

Recommended publications