LOGO-L> 7 second order syrfaces in a compact code 
Author Message
 LOGO-L> 7 second order syrfaces in a compact code

to a
;Hello Every Body
;Here is an isometric_view code to generate 7 different second order
;surfaces using the simple grid algorithm together with cylindrical
;co-ordinate procedure which facilitates the code too much.That is
;why such demo which tries to catch many birds with one stone is only
;15 hundred bytes.(hi Yehuda ! I wait your comments?).
;Best Regards
;Mhelhefny
;----------------------
end

to cylpos :r :fi :y
mysetxyz :r*cos :fi :y :r*sin :fi
end

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

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

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

to go  
ts ct pr[] pr[there is second order surfaces :-]pr[]
for [i 1 7][pr (se :i ": "the s :i "...)] pr[]
type (se [please input surface number] char 9) make "e rw
f2 cs ht pu grid :l 80 info
type (se "again "y/n char 9) make "d rc
if :d = "y [go]
end

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

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

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

to info
pu setxy -250 50 label [second order surfaces]
sety 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]
            [single sheet hyperboloid][cone]]
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 ifelse :r >0 [30+sqrt (:a* :a)+(:r* :r)][-30-sqrt (:a* :a)+(:r* :r)]
end

to y7
op :r*2
end
;------------------
---------------------------------------------------------------





Tue, 23 May 2000 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. WTD: 'ls -lR '->HTML code

2. LOGO-L> Second Announcement

3. column order -> row order

4. column order -> row order

5. compact disc logo

6. Fortran source code for 8th order RKS and RKV with 9th order error control

7. LOGO-L> Apple logo/MSW Logo

8. LOGO-L> Reseach Machines Logo (RM LOGO)

9. Graphics>>Rectangle>>intersects: erroneous code

10. LOGO-L> #33-d second order surface, hyperboloid

11. Seconds -> hh:mm:ss >24h

12. Second Post: Different group and sort order in RW

 

 
Powered by phpBB® Forum Software