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

Re: LOGO-L> Ellipses



I'm going to try to resist giving you the whole answer and make you
work a little for it (I'm trying to follow my own recommendation). Giving
you the whole answer would spoil the fun of discovering it for yourself.

One way to draw a circle is this:

to poly :ang
repeat :ang [fd 1 rt 1]
end

It's convenient but is has several problems with it that I don't
care to go into nor do a lot of readers hear (go back in the archives)
to read more.

An alternative way to draw a circle is directly with trig functions.
Admittedly not something you'd get into with a 6th grader.

to circle :sweep :rad
localmake "pos pos
local "x
local "y
localmake "ang 0
pu
repeat :sweep ~
   [
   make "x :rad * (sin :ang)
   make "y :rad * (cos :ang)
   setxy :x :y
   pd
   make "ang :ang + 1
   ]
pu
setpos :pos
end

The way ellipsearc is done is exactly how you draw a circle with
trig functions. But the EllipseArc allows you to "deform" the circle.
To make circle function above into ellipse is simple. The circle function
also has a problem that it only draws at the center that is also trivial
to fix.

If you want to get into all the capabilities of "EllipseArc" which allows
you start sweeping at any angle then it gets a little trickier. But I'll
assume you just looking for an Ellipse at this point.

There are other ways to draw an ellipse with other qualities that others
may wish to talk about. Maybe they won't give the whole answer to those
solutions as well because they are also fun to discover on your own.

Tristero15@aol.com wrote:
> 
> I am trying to get a turtle in  microworlds to glide in the shape of an
> ellipse.  Is there a command that will do this.  In MSWLogo, there is
> ellipsearc.  Can anybody tell me how to get the definition of ellipsearc if
> there is no command in microworlds.  thank you.
> 
> -adam
> ---------------------------------------------------------------
> 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.

-- 
===============================================================
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