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

LOGO-L> Intersection of surfaces



;Hello Everybody 
;Here is the code to see the line of intersction of
;surfaces;in this case the intersection of the surface
;of a cylinder with that of a cone,and a cylinder with
;an elipdoid.
;The intersection of surfaces is one of the important
;parts of Mong's descriptive geometry.
;Best regards.
;Mhelhefny
;-------------------
to cone :a 
for [fi 0 360 10][for [r 0 :a 20][
polystart pd
                 setxyz x2 y2 z2
make "fi :fi+ 10 setxyz x2 y2 z2
make "r :r+20    setxyz x2 y2 z2
make "fi :fi- 10 setxyz x2 y2 z2 
polyend
pd]pu]
end

to cyl :r :a
for [fi 0 360 10][for [l -:a :a 20][
polystart pd
                 setxyz x y z
make "fi :fi+ 10 setxyz x y z
make "l :l+20    setxyz x y z
make "fi :fi- 10 setxyz x y z 
polyend]pu]
end

to ellip :a :b :c
for [fi 0 360 10][for [ti 0 170 10][
polystart pd
                 setxyz x1 y1 z1
make "fi :fi+ 10 setxyz x1 y1 z1
make "ti :ti+10  setxyz x1 y1 z1
make "fi :fi- 10 setxyz x1 y1 z1 
polyend]pu]
end

to go
   cs ht setsc 0
   perspective
   ask -1[setxyz 1200 -500 900]
   setpc [0 0 128]
   cyl 80 200
   shade 200 90 20 
   cone 200 polyview
   ellip 180 80 80 polyview
end

to shade :f :g :h
ask -3[setxyz :f :g :h]
polyview
End

to x
op :r* cos :fi
end

to x1
op (:b* sin :fi)*(sin :ti)
end

to x2
op :r* cos :fi
end

to y
op :r* sin :fi
end

to y1
op (:a* cos :fi)*(sin :ti)
end

to y2
op :r*2- 170
end

to z
op :l
end

to z1
op -200+ :c* cos :ti
end

to z2 
op :r* sin :fi
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