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

LOGO-L> Snail in MswLogo



;Hello everybody !
;Here is the code to draw a snail.
;N.B. for Yehuda :
;If you like it, you may change the .4 in the r procedure to be .2
;Best Regards
;Mhelhefny
;-----------------
to go
   cs ht setsc 0
   perspective
   setpc [0 0 128]
   snail 120
   shade 20 150 250 
   polyview
end

to r
op .4*(:fi+ :a) * sin :theta
end

to shade :f :g :h
ask -3[setxyz :f :g :h]
polyview
End

to snail :a
for [fi 55 390 10][for [theta 0 180 10][
polystart
pd
                           sppos r :fi :theta
localmake "theta :theta+10 sppos r :fi :theta 
localmake "fi :fi+10       sppos r :fi :theta 
localmake "theta :theta-10 sppos r :fi :theta 
localmake "fi :fi-10       sppos r :fi :theta 
polyend
pd]pu]
end

to sppos :r :fi :theta
;sphirical co-ordinates procedure
setxyz :r*(sin :theta)*cos :fi :r*cos :theta :r*(sin :theta)*sin :fi  
end
;--------------
---------------------------------------------------------------
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