;Hello Everybody
;Here is a revised code to demonstrate several surfaces on
;the same screen.
;Best regards
;Mhelhefny
;--------------------
to go
cs ht pu setsc 0
perspective
setpc [0 0 128]
setturtle -1 setxyz 1000 850 500
setturtle 0
for [i 1 2][for [j 1 3][shade 80 200 30
grid :i*280 :j*280 (:i- 1)*3+ :j polyview]]
end
to grid :aa :bb :i
for [fi 0 360 15][for [r -70 70 10][
polystart pd
xzcylpos :aa :bb :r :fi run word "y :i
make "r :r+ 10 xzcylpos :aa :bb :r :fi run word "y :i
make "fi :fi+ 15 xzcylpos :aa :bb :r :fi run word "y :i
make "r :r- 10 xzcylpos :aa :bb :r :fi run word "y :i
polyend
pd]pu]
end
to shade :f :g :h
ask -3[setxyz :f :g :h]
polyview
End
to xzcylpos :aa :bb :r :fi :y
;lib proc for cylindrical coordinates
setxyz -500+ :aa+ :r*cos :fi :y :bb+ -600+ :r*sin :fi
end
to y1
op ifelse :r >0 [:r* :r/50 ][-10*sqrt(-:r)]
end
;-------------
to y2
op ifelse :r >0 [sqrt 5000+(:r* :r)][-sqrt 5000+(:r* :r)]
end
to y3
op :r *cos :r*3
end
to y4
op (5e2*sin 15* :r)/(:r+ 3e-3)
end
to y5
op (5e4*sin 17* :r)/(:r* :r + 2e-5)
end
to y6
op :r
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