aUCBLogo Demos and Tests / drawangulardistribution
to drawangulardistribution
draw updategraph stop
setUpdateGraph "false
a=0
forever
[ clearScreen
;pr repcount
catch "error [ignore runResult [draw]]
err=Error
if :err != []
[ clearText
print :err.2
waitMS 200
]
updategraph
updateVars
dispatchMessages
waitMS 100
if Key? [stop]
]
end
to draw
; perspective
clearScreen
WindowMode
setPenSize 0
expo=1
for [theta 1 180 1]
[ factor=(sin theta)*expo
+(power (abs cos theta) 1000*(1-expo))*20*(1-expo)
factor=1/(abs sin theta)^expo
phi=0
; for [phi 0 -180 -10]
; [
setSpherePos 300*(sin theta)*factor phi theta
; ]
]
end