Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[LogoForum] Ellipse

8 views
Skip to first unread message

John St. Clair

unread,
Feb 18, 2009, 12:10:52 AM2/18/09
to
The message below is being cross-posted from the LogoForum. Please
reply here at comp.lang.logo and it will be crossposted back to the
LogoForum. The original author of this message is
mjs...@btinternet.nospam.com. This message was sent earlier with 2
attachments but didn't seem to get posted. So I'm posting it now
without the attachments.

Some time ago there was a discussion about methods
for constructing an ellipse. One such method found
in Turtle Geometry: Abelson & DiSessa involved combining
vectors from 2 circles of different radii.
I came back to this method recently and realised
that combining two vectors in this way was equivalent to
plotting the path of a point on the circumference of a rotating
circle(A) the centre of which also moves around a circle(B), the two
rotations being in opposite directions but equal rates.
I attach a demonstration (MSWLogo) which shows how the circles
determine the dimensions of the ellipse.
If the rates of rotation are not equal other curves are produced.
Of course the centre of curve (B) can itself move around another
circle and so on!
Mike

John St. Clair

unread,
Feb 18, 2009, 12:13:44 AM2/18/09
to
The message below is being cross-posted from the LogoForum. Please
reply here at comp.lang.logo and it will be crossposted back to the
LogoForum. The original author of this message is
dale...@worldnet.nospam.att.net.

Good one Mike!

Could not find the explanation in my copy of "Turtle Geometry: Abelson &
DiSessa" of why an ellipse is drawn but there is further information at:

http://www.cut-the-knot.org/Curriculum/Geometry/DynoEllipse.shtml

with an interesting applet. Dale


In article <john.stclair-42FA...@news.verizon.net>,

John St. Clair

unread,
Feb 18, 2009, 12:17:05 AM2/18/09
to
The message below is being cross-posted from the LogoForum. Please
reply here at comp.lang.logo and it will be crossposted back to the
LogoForum. The original author of this message is
mjs...@btinternet.nospam.com.


Thanks Dale,
I like the applet.
There is no direct explanation in "Turtle Geometry"
 A simpler(?) approach using turtle geometry:
 
to aa
 cs ht pu
 ellipse 200 100 60
end
 
to ellipse :a :b :offset_angle 
 ; :a IS THE SEMI-MAJOR AXIS, :b THE SEMI-MINOR AXIS
 setturtle 0 ht pu
 setturtle 1 ht pu
 local [r1 r2 incr_angle p]
 make "r1 (:a+:b)/2
 make "r2 (:a-:b)/2
 make "incr_angle 5
 
 (repeat 360/:incr_angle+1
   [setturtle 0 pu home
    ;90 IS REQUIRED TO START THE
    ;ELLIPSE OFF ALONG THE X AXIS IN THE USUAL WAY
    ;SINCE THE TURTLE ANGLES ARE MEASURED
    ;FROM THE VERTICAL
    seth 90-(:incr_angle*repcount+2*:offset_angle) fd :r1
   ;BOUNDARY OF INNER CIRCLE
    seth 90+:incr_angle*repcount fd :r2
    ;BOUNDARY OF OUTER CIRCLE
    make "p pos
    setturtle 1 setpos :p pd
   ])
end
 
The ellipse can be rotated by any angle (:offset_angle) and
moved anywhere by replacing 'home' by setpos [x0 y0].
Mike


In article <john.stclair-87C1...@news.verizon.net>,

Erich Neuwirth

unread,
Feb 20, 2009, 9:47:41 AM2/20/09
to
Here is a more turtlelike implementation.
forward.net performs a few movements with penup and
then does the net position change as one forward in the
right direction. It allows superposition of 2 movements.


to ellipse :len1 :len2
foreach iseq 0 360 [
forward.net [
setheading ?
forward :len1
setheading -1 * ?
forward :len2
]
]

end

to forward.net :prog
localmake "startpos pos
penup
run :prog
localmake "endpos pos
setpos :startpos
pendown
setpos :endpos
end

0 new messages