Hi Jim, At 06:23 PM 10/27/97 -0600, you wrote: >Chuck ==> > >Here's a procedure that does just what you stated above. Other than some >added steps, how does this differ from the polygon procedure? It's still FD >1, RT 1 repeated for as many times as required to draw a line equidistant >from a center. > >TO CIRCLE :SIDE >HOME CS PU >REPEAT 360 [FD :SIDE POINT BK :SIDE RT 1] >END The obvious difference between the above CIRCLE and a "classic" polygon-based procedure (call it MCIRCLE) is that CIRCLE draws a circle around the turtle position, while MCIRCLE draw a circle which is tangent to the direction of the turtle. BTW, I would remove HOME CS from the function, to make it more general. But other than the above, CIRCLE differs from MCIRCLE in two very fundamental ways. A mathematical circle is defined by two parameters: its center, and its radius. If you have a specific circle in mind (=defined by a specific center+radius), you can use CIRCLE to draw it for you. But you cannot use MCIRCLE because you never know what center and radius you'll get. That's why I call it MCIRCLE -- Mystery Circle. Note that the mystery is even bigger if the caller doesn't know how MCIRCLE is implemented, e.g., with 180 iterations of RIGHT 2, vs. 360 iterations of RIGHT 1. The other difference is more subtle, yet important. MCIRCLE is implemented with three variables: the FORWARD amount, the RIGHT amount, and the iteration count. The three are interrelated in a somewhat complex way. For example, you have to make sure that 360 modulo the RIGHT amount is zero. In CIRCLE, the only number that matters is the radius (what you call SIDE). The RIGHT amount can be any non-zero number. It can even be a random number, with a different value in each iteration. And the RIGHT can be replaced with LEFT. Likewise the iteration count can be any number, and the bigger it gets, the "more" circle you get. This last issue is related, I think, to what Mike Doyle was saying. The relation between MCIRCLE and a mathematical circle is somewhat fuzzy. Mike's mistake, if I understand him correctly, is that he thought that MCIRCLE is the only Logo-ish way to draw circles. But maybe I missed something in what Mike was saying. Chuck Shavit --------------------------------------------------------------- Please post messages to the Logo forum to logo-l@gsn.org. Mail questions about the list administration to logofdn@gsn.org. To unsubscribe send unsubscribe logo-l to majordomo@gsn.org.
Global SchoolNet Foundation -
Linking Kids Around the World!
Copyright GSN - All Rights Reserved
- Comments
& Questions
Visit GSN's
Global
Schoolhouse for more exciting learning resources!
Search our Site
-
Home