Hello all,<snip>
===============Curving Stitching Procedures Follow================
to cardioid
cg st init
setcircle 100 72
make "t 0
repeat 36 [make "t :t + 1 stitch :t :t * 2]
repeat 36 [make "t :t + 1 stitch :t (:t - 36) * 2]
endto nephroid
cg st init
setcircle 100 72
make "t 0
setc 2 repeat 24 [make "t :t + 1 stitch :t :t * 3]
repeat 24 [make "t :t + 1 if (:t > 36) [setc 5] stitch :t (:t - 24) * 3]
repeat 24 [make "t :t + 1 stitch :t (:t - 48) * 3]
endto placepoint
dot
output pos
endto dot
pd fd 0 pu
endto setplace
pu
make "pointlist se :pointlist butlast list placepoint []
endto setline :length :n
pu
repeat :n [fd :length / :n make "pointlist se :pointlist butlast list
placepoint []]
endto setcircle :radius :n
pu rt 360 / :n
repeat :n [ fd :radius make "pointlist se :pointlist butlast list
placepoint [] bk :radius rt 360 / :n]
endto stitch :a :b
pu
setpos item :a :pointlist
seth towards item :b :pointlist
pd setpos item :b :pointlist pu
endto init
clearnames
make "pointlist []
end;The following 3 procedures are to provide compatibility between LogoWriter
and UCBLogoto cg
cs
endto clearnames
erns
endto setc :color
setpencolor :color
end
Hi,
Here's a different approach to draw Cardioid and Nephroid. The following short codes are for MSWLogo and UCBLogo. The Cardioid and the Nephroid are the envelope of the relevant images:
to main
; Cardioid
cs ht pu rt 90
setsc 0 setpc 6 draw 35
end
to draw :rad
repeat 32[fd :rad pd
circle distance se 0 :rad
pu bk :rad rt 360/32]
end
============================
to main
; Nephroid
cs ht pu
setsc 0 setpc 4 draw 46
end
to draw :size
repeat 32[fd :size pd
circle xcor
pu bk :size rt 360/32]
end
Regards...
[[Yehuda]]
_/ _/ _/ _/_/_/_/_/
_/_/_/_/
_/ _/ _/_/
_/ _/
_/_/_/ _/ _/ _/
_/
_/ _/ _/_/_/_/ _/
_/
_/ _/_/ _/ _/
_/_/_/_/
http://www.geocities.com/CollegePark/lab/2276/
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