[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: LOGO-L> Total Turtle Trip



Jim Muller wrote:
> 
> George ==>
> 
> Frankly, I could care less about what's "best." I wouldn't know what
> it was if it came up and bit me. I'm asking out of ignorance, believe
> me.

If you don't care what's "best" then what's the point in
discussing it further because it's our viewpoints of what we
each think is "best" that differs.

Try these 3 routines, modified to allow you to exagerate the problem.

TO POINT
SETPENSIZE [5 5] PD FD 1 BK 1 PU
END

TO CIRCLE1 :CENTER :RADIUS :POINTS
PU SETPOS :CENTER
REPEAT :POINTS [FD :RADIUS POINT BK :RADIUS RT 360/:POINTS]
END

to TEST1
CS
MESSAGEBOX [] [3]
CIRCLE1 [0 0] 100 3
MESSAGEBOX [] [4]
CIRCLE1 [0 0] 100 4
MESSAGEBOX [] [360]
CIRCLE1 [0 0] 100 360
end

;Notice how in the above the center is always the same no matter
;how good or bad the resolution is.

TO CIRCLE2 :CENTER :RADIUS :POINTS
PU SETPOS :CENTER
SETX XCOR - :RADIUS SETH 0 PD
REPEAT :POINTS [FD (:RADIUS * 2) * PI/:POINTS RT 360/:POINTS]
PU SETPOS :CENTER PD
END

TO TEST2
CS
MESSAGEBOX [] [3]
CIRCLE2 [0 0] 100 3
MESSAGEBOX [] [4]
CIRCLE2 [0 0] 100 4
MESSAGEBOX [] [360]
CIRCLE2 [0 0] 100 360
END

;Notice how the center moves, the circle is not even on center until you
;reach infinity. Many folks fix this by.

TO CIRCLE3 :CENTER :RADIUS :POINTS
PU SETPOS :CENTER
SETX XCOR - :RADIUS SETH 0 PD
RT 180/:POINTS
REPEAT :POINTS [FD (:RADIUS * 2) * PI/:POINTS RT 360/:POINTS]
LT 180/:POINTS
PU SETPOS :CENTER PD
END

TO TEST3
CS
MESSAGEBOX [] [3]
CIRCLE3 [0 0] 100 3
MESSAGEBOX [] [4]
CIRCLE3 [0 0] 100 4
MESSAGEBOX [] [360]
CIRCLE3 [0 0] 100 360
END

; Notice how badly the 3 "pointed" circle missed the "real" circle.
; The 360 point circle misses the "real" circle just as badly.
; Only the first vertex landed on the "true" circle. Where as CIRCLE1
; they ALL are on the circle regardless of resolution 1 to infinity
; number of points.

> 
> Here's the first procedure I offered. It's been in all my books as
> the classic definition of a circle...a curved line where all points
> on the line are equidistant from the center.
> 
> TO CIRCLE :RADIUS
> HOME CS PU
> REPEAT 360 [FD :RADIUS POINT BK :RADIUS RT 1]
> END
> 
> TO POINT
> PD RT 90 FD 1
> BK 1 LT 90 PU
> END
> 
> Chuck was unhappy that CIRCLE used HOME CS so let's change it.
> 
> TO CIRCLE :CENTER :RADIUS
> CS PU SETPOS :CENTER PD
> REPEAT 360 [FD :RADIUS POINT BK :RADIUS RT 1]
> END
> 
> This now draws a series of points around a center defined by the user.
> 
> QUESTION:
> 
> You said that this procedure uses "one point" whereas I see 360 points.
> What do you mean by "one point?"
> 
> You also suggested using 4 points. Can you provide me with an example
> of what you mean?
> 
> QUESTION:
> 
> I could make it 360,000 points and RT 0.001. However, that doesn't change
> the basic relationship that I see of REPEAT 360 [FD whatever RT or LT
> whatever].  The only difference that I see is that some extra steps
> have been added.
> 
> What am I missing here? Yes...there's the obvious difference of starting
> from the outside as opposed to starting from the center. Is that it?
> 
> QUESTION:
> 
> In TGLA, I move from working shapes to working with polygons and then
> move on to circles, stars, etc. Once readers have worked with the above
> procedure, there's a separate project on the evolution of PI. PICALC.LGO
> lets them calculate PI to 50 or more places. Then we get into the ARC
> and CIRCLE procedures similar to the one below.
> 
> TO CIRCLE :CENTER :RADIUS
> PU SETPOS :CENTER
> SETX XCOR - :RADIUS SETH 0 PD
> REPEAT 360 [FD (:RADIUS * 2) * PI/360 RT 1]
> PU SETPOS :CENTER PD
> END
> 
> If :RADIUS is not the radius of the circle, what is? How would you
> calculate the real radius?  Can you provide an example?
> 
> I'm sorry to be so dense. I'm not trying to hold on to any outdated
> methodologies.  I'm simply trying to learn what I am missing.  It seems
> that I've made some incomplete or inaccurate statements in TGLA.  Can
> you help me understand so I can correct them?
> 
> Thanx...Jim

-- 
===============================================================
George Mills
email: mills@softronix.com
http://www.softronix.com
The www page contains some very powerful educational software.
Our single most important investment is our kids.
---------------------------------------------------------------
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