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

LOGO-L> languages



;Hello Every Body
;Here is an update of my isometric view demo.This demo shows seven
;second degree surfaces. The code is written to run with UCBLogo.
; For MSWLogo you should add rt 90 befor any label key word, and 
;remove ct from the go procedure.
;The code took less than 1300 bytes.Can any body tell me the name
;of another language that rivals logo in this.? 
;Best Regards.
;Mhelhefny
;--------------------------- 
to cylpos :r :fi :y
mysetxyz :r*cos :fi :y :r*sin :fi
end

to f
ifelse (abs :r)< 10 [pu][pd]
end

to go  
ts pr[] pr[there is 7 second degree surfaces :-]pr[]
for [i 1 7][pr (se :i ": "the s :i "...)] pr[]
wait 70
for [e 1 7][h cs ht pu grid :l 80 info wait 40]
end

to grid :l :a
grid1 :l :a grid2 :l :a
end

to grid1 :l :a
for [fi 0 360 10][for [r :l :a 10][ 
cylpos :r+ :d :fi run word "y :e 
ifelse :e=4 [f][ifelse :e=5[f][pd]]]pu]
end

to grid2 :l :a
for [r :l :a 10][for [fi 0 360 10][ 
cylpos :r+ :d :fi run word "y :e 
ifelse :e=4 [f][ifelse :e=5[f][pd]]]pu]
end

to h
make "d ifelse :e=3 [30][0]
make "l ifelse :e=2 [1][ifelse :e = 6[0][-80]]
end

to info
pu setxy -300 20 label (se :e ": s :e)
end

to mysetxyz :a :b :c
setxy (:a- :c)*cos 30 :b- (:a+ :c)*sin 30
end

to s :i
op item :i [[paraboloid][horn][cup][sphere][two sheet hyperboloid]
            [cone][moebus strip]] 
end

to y1
op :r* :r/40
end

to y2
op 20*sqrt(:r)
end

to y3
op ifelse :r >0 [15*sqrt(:r)][-15*sqrt(-:r)]
end

to y4
op ifelse :r >0 [sqrt (:a* :a)- (:r* :r)][-sqrt (:a* :a)- (:r* :r)]
end

to y5
op ifelse :r >0 [sqrt (:a* :a)+(:r* :r)][-sqrt (:a* :a)+(:r* :r)]
end

to y6
op :r*2
end

to y7
op (:a*2 + sin :fi)*cos :fi*2
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