Yes, I realized that soon after I posted the same fix. Still, I consider it a gross error for 64bit floating point math. What you see is still not floating point errors. It's because the vertices are not on the circle which is a nice property to have. Thanks for correcting me though. Yehuda Katz wrote: > > George Mills wrote: > > > > Your correct, there is nothing in the universe that can create > > a perfect physical representation of a circle. But you can choose > > between different approximations to get different properties. > > > > The "equidistant from center" method has some nice properties the > > "poly" method does not (assuming a finite number of points of course > > on a finite precision machine). > > > > TO CIRCLE :RADIUS :POINTS > > REPEAT :POINTS [FD (:RADIUS * 2) * PI/360 RT 1] > > END > > > > TO DIFF > > CIRCLE 100 90 > > SHOW POS > > CS > > ARC2 90 100 > > SHOW POS > > END > > > > DIFF > > [99.124796 100.870126] <<<< See how far off POLY is > > [100 100] <<<< ARC2 basically uses the "equidistant model" > > George, > > You can minimize considerably the error in the above CIRCLE by saying: > > ====================================================== > TO CIRCLE :RADIUS :POINTS > REPEAT :POINTS [rt .5 FD (:RADIUS * 2) * PI/360 rt .5] > END > > TO DIFF > cs > CIRCLE 100 90 > SHOW POS > CS > ARC2 90 100 > SHOW POS > END > > DIFF > [100.001269 100.001269] > [100 100] > ====================================================== > > [[Yehuda]] -- =============================================================== 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