1 3REM T R I A N G
2 4REM
3 6 PRINT "TRIANG"
4 10 DIM A10,B10,C10,H10,R10,S10
5 100 PRINT
6 105 DEF FNSI= .01*INT6000*BI-INTBI+.5
7 110 PRINT "THIS PROGRAM WILL FIND THE UNKNOWN FEATURES OF ANY"
8 115 PRINT "TRIANGLE, GIVEN ONE SIDE AND ANY TWO OTHER PARTS."
9 120 PRINT
10 125 PRINT
11 130 PRINT "WHAT WILL BE GIVEN 1=SSS 2=SAS 3=SSA 4=ASA 5=AAS";
12 135 INPUT N
13 140 PRINT
14 145 LET R8=0
15 150 LET R9=0
16 155 IF N-1*N-2*N-3*N-4*N-5=0 THEN 170
17 160 PRINT "ANSWER 1, 2, 3, 4, OR 5 PLEASE...."
18 165 GOTO 125
19 170 IF N=1 THEN 210
20 175 PRINT "NOTE: SPECIFY ANGLES AS 'DEGREES, MINUTES, SECONDS' OR"
21 180 PRINT " 'DEGREES, MINUTES.DECIMAL, 0' I.E. SECONDS=0"
22 185 PRINT
23 190 IF N=2 THEN 230
24 195 IF N=4 THEN 270
25 200 IF N=5 THEN 335
26 205 IF N=3 THEN 385
27 210 PRINT "WHAT ARE SIDE1, SIDE2, SIDE3";
28 215 INPUT S1,S2,S3
29 220 GOSUB 540
30 225 GOTO 630
31 230 PRINT "WHAT ARE SIDE1, ANGLE3, SIDE2";
32 235 INPUT S1,A3,B3,C3,S2
33 240 GOSUB 830
34 245 LET I=3
35 250 GOSUB 620
36 255 LET S3=SQRS1^2+S2^2-2*S1*S2*COSR3
37 260 GOSUB 540
38 265 GOTO 630
39 270 PRINT "WHAT ARE ANGLE1, SIDE3, ANGLE2";
40 275 INPUT A1,B1,C1,S3,A2,B2,C2
41 280 GOSUB 830
42 285 FOR I=1 TO 2
43 290 GOSUB 620
44 295 NEXT I
45 300 LET R3=3.14159265-R1-R2
46 305 LET I=3
47 310 GOSUB 575
48 315 FOR I=1 TO 2
49 320 GOSUB 530
50 325 NEXT I
51 330 GOTO 630
52 335 PRINT "WHAT ARE ANGLE3, ANGLE1, SIDE3";
53 340 INPUT A3,B3,C3,A1,B1,C1,S3
54 345 GOSUB 830
55 350 FOR I=1 TO 3 STEP 2
56 355 GOSUB 620
57 360 NEXT I
58 365 LET R2=3.14159265-R1-R3
59 370 LET I=2
60 375 GOSUB 575
61 380 GOTO 315
62 385 PRINT "WHAT ARE SIDE1, SIDE3, ANGLE1";
63 390 INPUT S1,S3,A1,B1,C1
64 395 GOSUB 830
65 400 LET R8=1
66 405 LET I=1
67 410 GOSUB 620
68 415 LET T=S3*SINR1/S1
69 420 IF T-1>0.0000001 THEN 515
70 425 IF 1-T>0.00000001 THEN 440
71 430 LET R3=1.57079632
72 435 GOTO 445
73 440 LET R3=ATNT/SQR1-T^2
74 445 LET R2=3.14159265-R1-R3
75 450 LET I=2
76 455 GOSUB 530
77 460 FOR I=2 TO 3
78 465 GOSUB 575
79 470 NEXT I
80 475 IF R9=1 THEN 510
81 480 IF S3>S1 THEN 490
82 485 GO TO 505
83 490 PRINT
84 495 PRINT "ONE SOLUTION IS:"
85 500 GO TO 510
86 505 LET R8 = 0
87 510 GOTO 630
88 515 PRINT
89 520 PRINT "NO SOLUTION POSSIBLE...."
90 525 GOTO 800
91 530 LET SI=S3/SINR3*SINRI
92 535 RETURN
93 540 LET P=S1+S2+S3/2
94 545 LET R=SQRP-S1*P-S2*P-S3/P
95 550 FOR I=1 TO 3
96 555 LET RI=2*ATNR/P-SI
97 560 GOSUB 575
98 565 NEXT I
99 570 RETURN
100 575 LET X1=57.2957795*RI
101 580 LET AI=INTX1
102 585 LET BI=60*X1-AI
103 590 IF ABS60-BI>0.00005 THEN 605
104 595 LET BI=0
105 600 LET AI=AI+1
106 605 IF ABSBI>0.0001 THEN 615
107 610 LET BI=0
108 615 RETURN
109 620 LET RI=AI+BI/60/57.2957795
110 625 RETURN
111 630 GOSUB 540
112 635 LET W=R*P
113 640 LET R1=S1/2*SINR1
114 645 LET H1=S3*SINR2
115 650 LET H2=S1*SINR3
116 655 LET H3=S2*SINR1
117 660 PRINT
118 665 IF R9=1 THEN 685
119 670 PRINT
120 675 PRINT " "," 1"," 2"," 3"
121 680 PRINT " "," -------"," -------"," -------"
122 685 PRINT
123 690 PRINT "SIDE",S1,S2,S3
124 695 PRINT
125 700 PRINT "ANGLE RAD",R1,R2,R3
126 705 PRINT
127 710 PRINT "ANGLE DEG",A1,A2,A3
128 715 PRINT " MIN", INTB1,INTB2,INTB3
129 720 PRINT " SEC", FNS1, FNS2, FNS3
130 725 PRINT
131 730 PRINT "ALT TO SIDE",H1,H2,H3
132 735 PRINT
133 740 PRINT
134 745 PRINT "RADIUS OF CIRCUMSCR CIRCLE = ";R1
135 750 PRINT "RADIUS OF INSCRIBED CIRCLE = ";R
136 755 PRINT " AREA OF TRIANGLE = ";W
137 760 PRINT
138 765 IF R9=1 THEN 800
139 770 IF R8=0 THEN 800
140 775 PRINT
141 780 PRINT "A SECOND SOLUTION IS:"
142 785 LET R9=1
143 790 LET R3=3.14159265-R3
144 795 GOTO 445
145 800 PRINT
146 805 PRINT
147 810 PRINT "ANOTHER CASE 1=YES";
148 815 INPUT Q
149 820 IF Q=1 THEN 120
150 825 STOP
151 830 FOR I=1 TO 3
152 835 LET BI= BI + CI/60
153 840 NEXT I
154 845 RETURN
155 9999 END