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

Re: LOGO-L> elipse



to ellipse :rad_x :rad_y
;
; There are several methods to describing an ellipse,
; this is just one of them and I prefer it because
; it's easy to conceptualize its size and calculate
; points that are exactly tangent.
;
; However, this is probably not the best method for
; describing elliptical trajectories.
;
make "orig_x first pos               ; Save current turtle pos x
make "orig_y last  pos               ; Save current turtle pos y
pu                                   ; Get to first point on ellipse
                                     ;   without drawing
repeat 361                           ; Sweep through 0 - 360 ~
   [
   make "ang repcount-1              ; For clarity create an
intermediate
                                     ;   variable
   make "x :orig_x-(sin :ang)*:rad_x ; Calculate New X coord
   make "y :orig_y-(cos :ang)*:rad_y ; Calculate New Y coord
   if :ang = 1 [pd]                  ; If we are already on the ellipse
                                     ;   then put the pen down
   setxy :x :y                       ; Draw a line segment
   ]
pu                                   ; Pen up for the trip back to the
                                     ; center of the ellipse
setxy :orig_x :orig_y                ; Restore original pos
; I'll leave it as an excercise to allow the ellipse to be rotated
; according to the turtles heading as MSWLogo's ellipse does
end


Richard Impey wrote:
> 
> A fellow teacher requires a MicroWorlds procedure for drawing an elipse so
> as to create a simulation of planets circling the sun. Is it possible to
> also have the "earth" turtle grow and shrink as it orbits??
> 
> Cheers Richard
> 
> =v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v
> 
>                         Richard Impey
>                         Assistant Principal (Acting)
>                         Learning Technologies and Art Specialist
>                         Phone 0011 61 3 9509 6872
>                         Caulfield North Primary School
>                         186 Balaclava Road
>                         Caulfield North 3161
>                         Melbourne, Victoria, Australia
> 
> =v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v
> =v
> 
> ---------------------------------------------------------------
> 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