Home
Project Folders
Teacher Resources
Student Resources
En ESPAÑOL
How Do I?
Literacy
MWForum
Site Map
Search
Our Team

polygons 1 2 3 4 5 6 7 8 9
Polygons 6
Try It
26 KB


Goal:   Find the length of the sides of a polygon drawn around a center point.


Screenshot


Vocabulary:   set, int

Code
Project Map

to polygon
t1, pu
t2, pu
setc whatcolor
setpensize howthick
repeat 1 + #sides [
t1, fd howbig
t2,
setlength_of_side int distance "t1
wait 10
setpos t1's "pos
if touching? "t2 "t1 [pd]
t1, bk howbig rt 360 / #sides
]
end

to reset
everyone [home]
cg
end



Notes

  1. Create a text box and name it length_of_side.   (The text box name must be only one word.)   If you wish, use the text menu to change the font and size of the text.

  2. In the revised polygon procedure, Setlength_of_side means: "Set the contents of the text box named length_of_side to the following input."

  3. Int distance "t1 means: "Measure the distance from the current turtle to t1 and report only the integer portion of the number (don't include any decimal portion)."

    Now as t2 prepares to move to each new position of t1, it measures and reports the distance in the text box.   You can compare the number(s) reported in the text box to the number on the howbig slider.




What If?
What happens if you remove the word int ?


Challenge
Compare the number in the text box to the number on the howbig slider (the measurement from the center point to each vertex).   Try different polygons.   For which polygon(s) is the length of each side less than howbig? For which polygon(s) is the length of each side greater than howbig? For which polygon(s) is the length of each side equal to howbig?
What is the largest possible side length for a triangle? square? pentagon?




© copyright 2001 - 2008  OpenWorld Learning.   All rights reserved.