| TRIANGLE.UTL file Copyright 1990 by David Denker | Z''=INFO:z'''=int((z''-int(z''/10000)*10000)/1000) if z'''=0}1 DSP N" SORRY, THIS FILE CAN ONLY BE RUN ON MATH EXTRA!"N WAIT5:QUIT #1:WLCC f15b6 TITLE= TRIANGLE PROGRAMS HEAD B0F13" Select by the FIRST LETTER or use MOUSE or  CURSOR keys." X=5:i=0:j=0:windd bb1bf16b11f0wr(X)wc25r6c26" Oblique triangle Quit Right triangle" #3:mon2:call60:if r=4}q:if r=5}c8 #4 if j=1}300:if j=2}q:if j=3}250:tone50:go3 #8:j=data k{0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,2,3,0,0,0,0,0,0,0,0}:ret #9:j''=data k{0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,3,2,0,0,0,0,0,0,0,0}:ret #32 HEAD ; "M"enu "R"edo "Q"uit ; x=0:j'=j:mon2:CALL60:j''=j:j=j':if r=1}34:IF R=4}Q:IF R=5}C9 if j''=1}1:if j''=2}4:if j''=3}q:tone60:go32 #34:if i>9999}}if i<10009}1:if i>10008}}if i<10017}4 if i>10016}q:quit #40:head ; Enter 0 to quit.;:ret #60 i=mloc:if i>9999}60 #61:k=kyck:if k<>0}62:I=MLOC:IF I>9999}}IF I<10079}66 i=mlin:if i=0}61:if i>99}64:if i>x-2}61:if i=j}61:j=i:goto63 #62:if k=13}65:if k=27}69 if k=272}}if j>0}}j=j-1:if k=280}}if j64}}if k<91}}k=k+32:if k>96}}if k<123}70 #63:if x=0}61:wlcc L(j):goto61 #64:i=i-int(i/100)*100:j=i:i=mloc:if i>9999}}if i<10079}66 #65:r=0:ret #66:r=1:ret:|top bar| #69:r=4:ret:|ESC| #70:r=5:k=k-97:ret:|A to Z| GO250 #249:beep:wait4 #250:cls:gos40 wind wr10wc78r1c0bb1bf14b11f0" Right Triangle Program: A Pick the two knowns |\ A & B are angles in and give their values. | \ degrees. y | \ h At least one side must The program will give you | \ be given. the unknowns. | \ |__________\ x B " #251 a=0:b=0:h=0:x=0:y=0:$i="0":row11 dsp" Pick the first known: (A,B,x,y,h) ":$i=inp(1):if $i="0"}q call 266:if c'=0}251 c''=c':dsp n" What is its value? ":i'=inp if i'=0}q:if sgn i'=-1}264:call267 dsp n #252 $i="0":dsp " Pick the second known: " $i=inp(1):if $i="0"}q:call 266:if c'=0}252 dsp n" What is its value? ":i'=inp:if i'=0}q:if sgn i'=-1}264 call267 c'=c''+c':if c'=24}260 if c'=2}261:if c'=4}261:if c'=8}261:if c'=16}261:if c'=32}261 if a=>90}263:if b=>90}263 if c'<13}253:c'=c'-8 #253 if h=0}254:if h<=x}262:if h<=y}262 #254 x=data c'{,,,x,,x,sqr(h^2-y^2),,,x,y*tan a,,h*sin a} y=data c'{,,,y,,sqr(h^2-x^2),y,,,x*tan b,y,,sqr(h^2-x^2)} if h<>0}255:h=sqr(x^2+y^2) #255:if a<>0}256:a=atn(x/y):b=90-a #256 dsp nn" A ="(a)n" B ="(b)n" x ="(x)n" y ="(y)n" h ="(h)n:GOTO32 #260:dsp n" ERROR: AT LEAST ONE SIDE MUST BE GIVEN!":goto249 #261:dsp n" ERROR: A KNOWN WAS USED TWICE!":goto249 #262:dsp n; ERROR: "h" must be greater than "x" or "y"!;:goto249 #263 dsp n" ERROR: AN ANGLE CANNOT BE EQUAL TO OR GREATER THAN 90ø!":GOTO249 #264:dsp n" ERROR: A KNOWN CANNOT BE NEGATIVE!":goto249 #266:c'=1:if $i="x"}r:if $i="X"}r:c'=2:if $i="y"}r:if $i="Y"}r c'=4:if $i="h"}r:if $i="H"}r:c'=8:if $i="a"}r:if $i="A"}r:c'=16 if $i="b"}r:if $i="B"}r:c'=0 dsp of4" ERROR: MUST pick (A,B,x,y,h)! ":beep:wait2 dsp os34o:ret #267:if c'<>1}268:x=i':ret #268:if c'<>2}269:y=i':ret #269:if c'<>4}270:h=i':ret #270:if c'<>8}271:a=i':b=90-a:ret #271:b=i':a=90-b:ret #299:beep:wait4 #300:cls:d'=0:gos40 wind bb1bf14b11f0wr9wc78r1c0" Oblique Triangle Program: A Pick three knowns and /\ A, B, & C are angles in give their values. / \ degrees. y / \ z At least one side must The program will give / \ be given. you the unknowns. /____________\ B x C"n #301:row10:$i="0" dsp" Pick the first known: (A,B,C,x,y,z) ":$i=inp(1):if $i="0"}q call 320:if t'=0}301 t''=t':dsp n" What is its value? " i'=inp:if i'=0}q:if sgn i'=-1}335:call321 dsp n #302:$i="0":dsp " Pick the second known: " $i=inp(1):if $i="0"}q:call 320:if t'=0}302:t''=t''+t' dsp n" What is its value? ":i'=inp:if i'=0}q:if sgn i'=-1}335 call321:dsp n #303:$i="0":dsp " Pick the third known: " $i=inp(1):if $i="0"}q:call 320:if t'=0}303:t''=t''+t' dsp n" What is its value? ":i'=inp:if i'=0}q:if sgn i'=-1}335 call321 if t''=56}333:if t''<>7}340 if x1}322:x=i':ret #322:if t'<>2}323:y=i':ret #323:if t'<>4}324:z=i':ret #324:if t'<>8}325:a=i':ret #325:if t'<>16}326:b=i':ret #326:c=i':ret #330 dsp n" ERROR: AN ANGLE CANNOT BE EQUAL TO OR GREATER THAN 180ø!":GOTO299 #331:dsp n" ERROR: A KNOWN WAS USED TWICE!":goto299 #333:dsp n" ERROR: AT LEAST ONE SIDE MUST BE GIVEN!":GOTO299 #334:dsp n" ERROR: TRIANGLE IS NOT POSSIBLE WITH DATA GIVEN!":GOTO299 #335:dsp n" ERROR: A KNOWN CANNOT BE NEGATIVE!":goto299 #340:if t''>14}350:if a=>180}330 t'=t'' #341 call342:if e'=2}331:if e'=1}334:call348:goto32 #342 if t'=11}345:if t'=13}347:e'=2:if t'<>14}r:e'=0:if y>z}344 #343 x=sqr(z*z+y*y-2*z*y*cos a):b=acs((x*x+y*y-z*z)/(2*x*y)):c=180-a-b:ret #344 y'=y:y=z:z=y':call343:y'=y:y=z:z=y':y'=b:b=c:c=y':ret #345 if x22}355:if b=>180}330 d'=1:t'=t''-19:t'=data t'{14,,11,13}:a=b:b=x:x=z:z=y:y=b:goto 341 #355 if t''>38}361:if t''<35}360:if c=>180}330 d'=2:t'=t''-35:t'=data t'{13,,14,11}:a=c:c=x:x=y:y=z:z=c:goto 341 #360 if a+b=>180}334:c=180-a-b:t'=t''-25:goto365 #361 if t''>44}362:if a+c=>180}334:b=180-a-c:t'=t''-41:goto365 #362 if b+c=>180}334:a=180-b-c:t'=t''-49 #365 if t'<>0}366:y=(x*sin c)/sin a:z=(x*sin b)/sin a:goto319 #366 if t'<>1}367:z=(y*sin b)/sin c:x=(y*sin a)/sin c:goto319 #367 if t'<>3}331:x=(z*sin a)/sin b:y=(z*sin c)/sin b:goto319 #400