MediaWiki:Sitenotice:
2024-03-02: The wiki ran out of disk space, so things were not working. This has been resolved by adding another 5GB of quota ;-) Thanks to Tim Lindner for reporting the issues. 2020-05-17: If a page gives you an error about some revision not being found, just EDIT the page and the old page should appear in the editor. If it does, just SAVE that and the page should be restored. OS-9 Al (talk) 12:22, 17 May 2020 (CDT)

TRIG1

From CoCopedia - The Tandy/Radio Shack Color Computer Wiki
Revision as of 21:37, 10 September 2015 by Polluks (talk | contribs) (Category)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
100 DIM AG(2), SD(3)
110 CLS: PRINT@4,"TRIGONOMETRIC FUNCTIONS"
120 PRINT@98,"FIND VALUES (ENTER ONE SIDE"
130 PRINT@130,"AND ONE ANGLE):"
140 PRINT@262,CHR$(136);: REM--DRAW TRIANGLE
150 PRINT@386,CHR$(136)+"   "+CHR$(136);
160 FOR I=387 TO 389
170 PRINT@I,CHR$(140);: NEXT I
180 FOR I=294 TO 358 STEP 32
190 PRINT@I,CHR$(138);: NEXT I
200 FOR I=293 TO 355 STEP 31
210 PRINT@I,CHR$(137);: NEXT I
220 PRINT@385,"A";: PRINT@391,"C";
230 PRINT@231,"B";: PRINT@323,"3";
240 PRINT@327,"1";: PRINT@420,"2";
250 PRINT@237,"SIDE 1=";: PRINT@274,"2=";
260 PRINT@306,"3=";: PRINT@364,"ANGLE A=";
270 PRINT@402,"B=";: PRINT@434,"C=  90"
280 REM -- FIND VALUES
290 S=0: P=212: REM--FIND SIDE
300 IF NOT (S<3) THEN 290
310 S=S+1
320 PRINT@P+(S*32),"";: INPUT A$
330 IFVAL(A$)=0 THEN 300
340 IF (VAL(A$)>0) AND (VAL(A$)<99999) THEN SD(S)=VAL(A$): GOTO360
350 PRINT@P+(S*32),"": GOTO320
360 A=0: P=340: REM--FIND ANGLE
370 IF NOT(A<2) THEN 360
380 A=A+1
390 PRINT@P+(A*32),"";: INPUT A$
400 IFVAL(A$)=0 THEN 370
410 IF (VAL(A$)>=1) AND (VAL(A$)<=89) THEN AG(A)=VAL(A$): GOTO430
420 PRINT@P+(A*32),"": GOTO390
430 REM -- FORMULAS
440 IF A=1 THEN AG(2)=90-AG(1)
450 IF A=2 THEN AG(1)=90-AG(2)
460 IF S<>1 THEN 480
470 SD(2)=SD(1)/TAN(AG(1)/57.2958279): GOTO500
480 IF S<>2 THEN 510
490 SD(1)=SD(2)*TAN(AG(1)/57.2958279)
500 SD(3)=SQR((SD(1)^2)+(SD(2)^2)): GOTO530
510 SD(2)=SD(3)*COS(AG(1)/57.2958279)
520 SD(I)=SQR((SD(3)^2)-(SD(2)^2))
530 P=212: REM--PRINT SIDES
540 FOR I=1 TO 3
550 IF I=S THEN 580
560 A$=STR$(SD(I))
570 PRINT@P+(I*32),"  "+MID$(A$,2,8)
580 NEXT I
590 P=340: REM--PRINT ANGLE
600 FOR I=1 TO 2
610 IF I=A THEN 640
620 A$=STR$(AG(I))
630 PRINT@P+(I*32),"  "+MID$(A$,2,8)
640 NEXT I
650 PRINT@480,"PRESS K TO RESTART";: A$=INKEY$
660 IF A$="R" THEN 110
670 GOTO650