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

LOGO-L> four cups



;Hello everybody
;Here is a revised code to draw four cups
;Best regards
;Mhelhefny
;---------------
to go
   cs ht setsc 0
   perspective
   ask -1 [setxyz 1100 700 200]
   setpc [0 0 128]
   grid 0 0 shade 200 130 200 
   grid 90 140 polyview 
   grid -100 120 polyview 
   grid 120 -90 polyview
end

to grid :aa :bb
for [fi 0 360 10][for [r -70 30 10][ 
polystart pd
                   xzcylpos :aa :bb :r :fi y 
make "r :r+ 10     xzcylpos :aa :bb :r :fi y
make "fi :fi+ 10   xzcylpos :aa :bb :r :fi y
make "r :r- 10     xzcylpos :aa :bb :r :fi y
polyend
pd]pu]
end

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

to xzcylpos :aa :bb :r :fi :y
setxyz :aa+ :r*cos :fi :y :bb+ :r*sin :fi
end

to y
op ifelse :r >0 [-10*sqrt(:r)][:r* :r/40]
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