[Thread Prev] [Thread Next]
On 20 Feb 2005 at 17:53, David Longman wrote:
> Another circle solution. This one treats the Turtle more like a robot than a
> graphics pen.
> No trigonometry at all!
> (Using MSWLogo)
> Here is version 1:
> to crawl
> if (distance :c) < :r [lt 1] ;if too close to centre of object turn away
> if (distance :c) > :r [rt 1] ;if too far from centre turn towards
> fd 1
And, if you were following the ellipse discussion in the LogoForum
group, here a is yet another way to draw an ellipse: using crawl.
The code is for MicroWorlds (notice how distance receives a
turtle name as input, not a coordinate) (a MW project is attached ;)
if composed_distance < :r [lt 1] ;if too close to centre of object turn away
if composed_distance > :r [rt 1] ;if too far from centre turn towards
output (distance "t2) + (distance "t3)
make "r 300
t1, pu setpos [-100 0] pd
t2, pu setpos [-50 0] pd
t3, pu setpos [150 0] pd
Description: Binary data
Previous by thread:
Circle and arc help
Next by thread:
-tools-.txt file questions
To save an attachment to your computer, PC users should right-click (Mac users, click and hold the mouse button) on the link and then choose 'save target as' from the pop-up menu. A window will then pop up in which you can choose a location for the file.