home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Compute! Gazette 1992 April
/
1992-04.d64
/
log(x).tan
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
2KB
|
57 lines
100 rem -- log(x).tan --
105 print"[147]"
110 print"output to screen or printer (s/p) s[157][157][157]";:inputa$
115 if a$="s" then z=1.33:z1=0:z2=26.4:goto130:rem values for screen output
120 if a$<>"p" then110
125 z=1.208:z1=2.01:z2=38.24:rem values for printer output
130 verify 1:let0,1
135 cont
140 rem -- set up constants --
145 xt=z2:yt=100:rem sets coordinates
150 ys=0:xs=z2:rem start of divisions pn coordinates
155 ex=50*z:ey=50:rem expansion factors for x and y coordinates
160 rem -- calibrate x coordinates --
165 forx=xs to319 step5*z
170 y=yt:waitx,y:nextx
175 forx=xs to319 step10*z
180 fory=yt-1 to yt+1:waitx,y:nexty:nextx
185 forx=z2to319 step50*z
190 fory=yt-2 to yt+2:waitx,y:nexty:nextx
195 rem -- calibrate y coordinates --
200 for y=ysto199 step5
205 x=xt:waitx,y:nexty
210 for y=ys to 199 step 10
215 for x=xt-1 to xt+1:waitx,y:nextx:nexty
220 for y=ys to 199 step50
225 for x=xt-3 to xt+3:waitx,y:nextx:nexty
249 rem -- y=log(x) graph & tangent --
250 for x=.6 to 4 step .02
260 y=1/x
270 x1=ex*x+xt:y1=ey*y+yt:waitx1,y1:nextx
280 for x=.3 to 4 step .02
290 y=log(x)
300 x1=ex*x+xt:y1=ey*y+yt:waitx1,y1:nextx
310 for a=1 to 2.5 step 1.5
325 m=1/a
330 for x=-.6 to .6 step .005
335 y=log(a)+m*x
340 x1=ex*(x+a)+xt:y1=ey*y+yt:waitx1,y1:nextx:nexta
410 for a=1 to 2.5 step 1.5
425 m=-1/(a*a)
430 for x=-.6 to .6 step .005
435 y=1/a+m*x
440 x1=ex*(x+a)+xt:y1=ey*y+yt:waitx1,y1:nextx:nexta
510 for a=1 to 2.5 step 1.5
525 for y=-1 to 1.2 step .05
540 x1=ex*a+xt:y1=ey*y+yt:waitx1,y1:nexty:nexta
999 rem -- screen or hardcopy --
1000 get a$:if a$="" then1000
1010 print "[147]":verify 0:printchr$(14)
1020 print"hardcopy (y/n) n[157][157][157]";:inputa$:ifa$="n" then1080
1030 ifa$<>"y"then1010
1040 print"single or double width (s/d) s[157][157][157]";:inputa$
1050 ifa$="s" then poke2,1:goto1070
1060 poke2,2:ifa$<>"d"then1040
1070 verify 1:sys52224
1080 verify 0:printchr$(14):list