Draws a surface z=f(x,y). From Roy Myer’s book Microcomputer Graphics.
Appears on
One of a series of library tapes. Programs on these tapes were renamed to a number series. This tape contained programs 20121 to 20163. These tapes were compiled by Tony Willing.
Source Code
1 REM this proqram 6.4 2 REM draws a surface z=f(x,y) 3 BRIGHT 1 4 LET ink=0 5 LET sx1=0: LET sy1=170 6 INK 7 7 REM converted to T/S 2068 by James N. Jones 2242 Locust Amarillo, Texas 79109 8 REM from the book by Myers Microcomputer Graphics 10 GO TO 40 20 LET xe=-x*s1+y*c1: LET ye=-x*c1*c2-y*s1*c2+z*s2: LET ze=-x*s2*c1-y*s2*s1-z*c2+rho 30 LET sx=d*xe/ze+cx: LET sy=cy+d*ye/ze: RETURN 40 LET rho=30: LET d=350: LET theta=.3: LET phi=1: LET cx=127: LET cy=87: LET s1=SIN (theta): LET s2=SIN (phi): LET c1=COS (theta): LET c2=COS (phi) 50 DEF FN z(x)=COS (.1*(x*x+y*y)) 60 REM color 70 FOR x=10 TO -10 STEP -1 80 LET fl=0 90 FOR y=-10 TO 10 100 LET z=FN z(x): GO SUB 20 110 IF sx<0 OR sx>255 OR sy<0 OR sy>175 THEN LET fl=0: GO TO 140 120 IF fl=0 THEN LET l=1: PLOT sx,sy 130 DRAW (sx1-sx),(sy1-sy) 135 LET sx1=sx: LET sy1=sy 136 INK 0 140 NEXT y 145 INK 7: LET sx1=0: LET sy1=170 150 NEXT x 9998 SAVE "SrfcPlot" LINE 1