
LOGO-L> torous in UCBLogo & MSWLogo
Quote:
>WoW!
>I just figured out how to copy a post to a file
>and load it into UCBLogo! Am I impressed
>or what? Awesome! I think I've come to the
>right place. I've just started working through
>Harvey's CSLS series. Incredible! The best
>kept secret on the Net is Logo.
--
>KW Melvin
>Spiral Computing
> http://www.*-*-*.com/
>>;Hello Every Body
>>;Here is the code to draw an isometric view of two eccentric spheres.
>>;The code runs as is on both UCBLogo & MSWLogo.
>>;Best Regards
>>;Mhelhefny
>>{snip}
;
;You are welcomed KW !!
;You can find many such code on USENET:comp.lang.logo for this month.
;Also you can find them on logo-l archives .
;Now let me use this occasion to send you the code for a totous.
;it will run under UCBLogo as is;and with the addition of a simple colour
;procedure to take care of RGB colours under MSWLogo.
;Best Regards.
;MHelhefny
;-----------------------------
to c
ifelse xcor >0 [setpc 6][setpc 4]
end
to go
cs ht pu
sphere1 150 sphere2 150
pu setxy -100 -180 pd label (se "with "complements "from "Mhelhefny)
end
to mysetxyz :a :b :c
;isometric transform
setxy (:a- :c)*cos 30 :b- (:a+ :c)*sin 30
end
to sphere1 :a
for [theta 0 180 9][for [fi 0 360 9][c sppos :a* sin :theta :fi :theta pd]pu]
end
to sphere2 :a
for [fi 0 360 9][for [theta 0 180 9][c sppos :a* sin :theta :fi :theta pd]pu]
end
to sppos :r :fi :theta
;sphirical co-ordinates
mysetxyz :r*(sin :theta)*cos :fi :r*cos :theta :r*(sin :theta)*sin :fi
end
;-------------------------------------------------------------
---------------------------------------------------------------