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

LOGO-L> spherical coordinates in 3d



;Hello Georg Mills
;Here is the simplist method to draw a sphere using spherical co-
;ordinates.
;This method is based on using sphirical the library procedure
; sppos which is used to setposition in spherical co-ordinates, i.e.
;the r, fi theta values. in this case,since the eqution of the 
;sphere in these coordinates is very simple:  r = const. no additinal
;equtions are needed.
;--------------------------------------------------------------
to go
turnon3d cs ht
sphere 200
end

to sphere :a
for [theta 0 180 10][for [fi 0 360 10][sppos :a :fi :theta pd]pu]
end

to sppos :r :fi :theta
;this could be a library procedure for sphirical co-ordinates
setxyz :r*(sin :theta)*cos :fi :r*cos :theta :r*(sin :theta)*sin :fi  
end

to turnon3d
; This is a library procedure for 3-d
perspective
setturtle -1
setxyz 1000 1000 1000
setturtle 0 
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