Your on a roll :-) Check out the attached GIF Someone could sure make an interesting web site/page of your work. MHELHEFNY@FRCU.EUN.EG wrote: > > ;Hello George Mills > ;Here is the code to replicate one of natures wonders the Snail > ;Its equation in spherical co-ordinates is R = 1.3 ^ fi * sin(theta) > ;where R , fi and theta are the spherical coordinates.The library > ;procedure sppos facilitates the coding. You can change the step > ;to any other value instead of 10. I appreciate very much your > ;comments on this simple code. > ;Best Refards > ;Mhelhefni > ;------------------------------------------------------- > to c > ifelse :fi > 240 [setpc col 1][setpc col 2] > end > > TO COL :N > ;library procedure for colors > OP ITEM :N [[255 0 0][0 255 0][0 0 255] > [255 255 0][0 0 0][130 130 130] > [30 200 200][255 0 255][200 200 100] > [120 20 120][200 100 50]] > END > > to go > turnon3d cs ht > snail1 snail2 > pu setxyz -200 -300 -200 pd rt label (se "THE "SNAIL "By "MHELHEFNY) > end > > to snail1 > for [theta 0 180 10][for [fi 0 380 10][c sppos y/5 :fi :theta pd]pu] > end > > to snail2 > for [fi 0 380 10][for [theta 0 180 10][c sppos y/5 :fi :theta pd]pu] > end > > to sppos :r :fi :theta > ;library procedure for sphirical co-ordinates > setxyz :r*(sin :theta)*cos :fi :r*cos :theta :r*(sin :theta)*sin :fi > end > > to turnon3d > ;library procedure for 3-d > perspective > setturtle -1 > setxyz -1100 1000 900 > setturtle 0 > end > > to y > op 50+ (power :fi 1.3)* sin :theta > end > ;---------------------------------------------------------- -- =============================================================== George Mills (mills@softronix.com) http://www.softronix.com/ The www page contains some very powerful educational software. Our single most important investment is our kids.
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