;Hello George Mills.
;Here is the code for a hemi-sphere or hemi-ellipsoid shell using
;the grid procedure given in the saddle and the "sombrero" surfaces.
;Best Regards.
;Mhelhefny.
;------------------------------------------------------------------
to grid :a :b :step
pu gridx :a :b :step
pu gridz :a :b :step
end
to go ; sphere (or ellipsoid if you put :a = say 25)
turnon3d
grid 15 15 first questionbox[input step (.5 - 1)][]
end
to gridx :a :b :step
for[x -:a :a :step][
for[z -:b :b :step][
setxyz :x*15 y*15 :z*15 pd]pu]
end
to gridz :a :b :step
for[z -:b :b :step][
for[x -:a :a :step][
setxyz :x*15 y*15 :z*15 pd]pu]
end
to turnon3d
perspective cs ht
setturtle -1
setxyz 900 900 900
setturtle 0
end
to y
ifelse((:x* :x)/(:a* :a) + (:z* :z)/(:b* :b))>1 [op 0][
op 20* sqrt( 1-((:x* :x)/(:a* :a) + (:z* :z)/(:b* :b)))]
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