Spheri

See all articles from SINCUS v4 n1
Author(s): Tony Cekolin
Publication: Sincus News
Pub Details: SINCUS v4 n1 (Volume 4, Issue 1)
Date: November - December 1985
Pages: 11
  11 REM "spheri"
21 BORDER 0
31 CLS
141 INPUT "Lower Theta Limit:";
a1
151 INPUT "Upper Phi Limit:";b2
161 INPUT "Upper Theta Limit:";
b1
171 INPUT "Lower Phi Limit:";a2
181 INPUT "Slices in Theta:";n
191 INPUT "Slices in Phi:";m
201 INPUT "Observation Angle:";
q
211 PRINT "S"
216 LET u=.0174532925
221 LET q=q*u
231 LET cs=COS (q)
241 LET si=SIN (q)
251 LET h1=(b1-a1)/127: LET h2=
(b2-a2)/(n-1)
261 LET h3=(b1-a1)/(m-1): LET h
4=(b2-a2)/127
271 LET m1=99999999: LET m2=m1:
LET n1=-m1: LET n2=n1
281 FOR y=a2 TO b2 STEP h2
291 FOR x=a1 TO b1 STEP h1
301 GO SUB 611
311 NEXT x
321 NEXT y
331 FOR x=a1 TO b1 STEP h3
341 FOR y=a2 TO b2 STEP h4
351 GO SUB 611
361 NEXT y
371 NEXT x
421 LET t1=(n1-m1)/2
431 LET t2=(n2-m2)/2
441 LET w=t1/t2
451 IF w<1.279830 THEN GO TO 48
1
461 LET xs=127: LET zs=127/w
471 GO TO 491
481 LET xs=99*w: LET zs=85
491 FOR y=a2 TO b2 STEP h2
501 FOR x=a1 TO b1 STEP h1
511 GO SUB 691
521 NEXT x
531 NEXT y
541 FOR x=a1 TO b1 STEP h3
551 FOR y=a2 TO b2 STEP h4
561 GO SUB 691
571 NEXT y
581 NEXT x
601 STOP
605 GO SUB 791
611 LET xt=xt-yt*cs
621 LET zt=zt-yt*si
631 IF xt>n1 THEN LET n1=xt
641 IF xt<m1 THEN LET m1=xt
661 IF zt>n2 THEN LET n2=xt
671 IF zt<m2 THEN LET m2=xt
681 RETURN
691 GO SUB 791
701 LET xt=127+INT (xs*(xt-yt*c
s-n1+t1)/t1)
711 LET zt=87-INT (zs*(zt-yt*si
-n2+t2)/t2)
715 IF xt<0 THEN LET xt=0
716 IF xt>255 THEN LET xt=255
721 PLOT xt,zt
781 RETURN
791 LET xa=x*u: LET c1=COS (xa)
: LET s1=SIN (xa)
801 LET ya=y*u: LET c2=COS (ya)
: LET s2=SIN (ya)
821 LET xt=(c1)*c2
831 LET yt=(c1)*s2
841 LET zt=s1
851 RETURN

“spheri” and “output” from Tony Cekolin, Mobile, AL. Tony adapted “spheri” from June 1984 Creative Computing and is very SLOW! “output” is copied from K-Power. Spheri may take up to 20 minutes to begin to plot. You are asked for upper and lower x and y or phi and theta limits. Then you are asked for the number of slices you want-cross sections. The controlling equations are lines 821 and 831. If someone can come up with more good rectangular or spherical coordinate systems which create more interesting surfaces, write me: Tony Cekolin, [address omitted].

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.