;Hello Everybody ;Here is the code to draw spherical shells implemented in spherical ;coordinates using sppos library procedure to translate the x,y,z values ;into r,fi,theta values (radius and two angles). ;the drawing is rendered using George Mills's innovation of 3d in ;MswLogo. ;Best regards. ;Mhelhefny ;----------------------- to go cs ht pu setsc 0 setpc [0 0 128] perspective sphere2 60 sphere1 100 shade 150 250 40 end to shade :c :d :e ask -3 [setxyz :c :d :e] polyview end to sphere1 :a for [fi 70 180 10][for [theta 0 360 10][ polystart pd sppos :a :fi :theta sppos :a :fi :theta+10 sppos :a :fi+10 :theta+10 sppos :a :fi+10 :theta polyend ]pu] end to sphere2 :a for [theta 90 180 10][for [fi 0 360 10][ polystart pd sppos :a :fi :theta sppos :a :fi :theta+10 sppos :a :fi+10 :theta+10 sppos :a :fi+10 :theta polyend ]pu] end to sppos :r :fi :theta 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