[MWForum]Elliptical orbits for planets
Dale Reed
mwforum@lists.mathcats.com
Fri, 7 Mar 2003 14:17:18 -0800
> The usual method for making an elliptical shaped flower bed in the garden
is to use 3 sticks and a piece of string.
That is what I am attempting to do with MSWLogo. Does not work for all
flower bed locations and there are no doubt other problems I have not
discovered yet. Also I want the turtle to stop after the ellipse is
finished. Dale
to aaa :focix1 :fociy1 :focix2 :fociy2 :twoA
; aaa -200 100 100 200 400
cs
pu
setxy :focix1 :fociy1
localmake "foci1 pos
foci
setxy :focix2 :fociy2
localmake "foci2 pos
foci
localmake "dist (distance :foci1) / 2
setheading towards :foci1 fd :dist
rt 90
fd sqrt( :twoA / 2 * :twoA / 2 - :dist * :dist)
rt 90 pd
repeat 8000 [
fd .1
do.until [localmake "A distance :foci1 localmake "B distance :foci2 rt .01
fd .01 ]
[ :A + :B < :twoA ]]
end
to foci
pd
circle 3
pu
end
---
$ dale-reed@att.net Seattle, Washington USA $