Let me know what you think

Ryan00101101 18 Jul 2016 02:38

New to this stuff wanted to write a right angle triangle solver

```
AxesOff
Degree
Horiz
Xmin→I
Xmax→J
Ymin→K
Ymax→L
0→Xmin
0→Ymin
30→Ymax
94→Xmax
0→E
2→F
ClrHome
ClrDraw
Text(-1,0,0,"ENTER ONE ANGLE")
Text(-1,8,10,"AND ONE SIDE"
Text(-1,16,0,"OR 2 SIDES")
Text(23,20,"PRESS X TO SOLVE")
Pause
ClrDraw
Text(17,37,"θ")
Text(7,66,"B")
Text(24,40,"ADJ")
Text(6,40,"HYP")
Text(12,72,"OPP")
Line(20,7,70,25)
Line(20,7,70,7)
Line(70,7,70,25)
Line(70,12,65,12)
Line(65,12,65,7)
Text(12,72,"OPP")
Lbl 0
If E≠0
Then
Pause "ERROR! ANGLE"
End
If F≠2
Then
ClrHome
Disp "ERROR!","ENTER","ONE ANGLE + SIDE","OR 2 SIDES","PRESS X TO SOLVE"
Pause
End
π→X
ClrHome
Input "θº:",θ
Input "Bº:",B
(θ+B)(θ≠X and B≠X)→Z
((Z≠90)(Z≠0))+((θ≥90)+(B≥90))→E
If E≠0:Goto 0
(90-B)(θ=X and B≠X)+θ(θ≠X)→V
(90-θ)(B=X and θ≠X)+B(B≠X)→B
V→θ
Input "ADJ:",A
Input "OPP:",O
Input "HYP:",H
(A≠X)+(O≠X)+(H≠X)+(θ≠0)→F
If F≠2
Then
Goto 0
Else
If θ=0 and O≠X and H≠X
Then
sin^-1(O/H)→θ
End
If θ=0 and A≠X and H≠X
Then
cos^-1(A/H)→θ
End
If θ=0 and O≠X and A≠X
Then
tan^-1(O/A)→θ
End
If A=X and H≠X
Then
Hcos(θ)→A
End
If A=X and O≠X
Then
O/tan(θ)→A
End
If O=X and H≠X
Then
Hsin(θ)→O
End
If O=X and A≠X
Then
Atan(θ)→O
End
If H=X and O≠X
Then
O/sin(θ)→H
End
If H=X and A≠X
Then
A/cos(θ)→H
End
(90-θ)(B=0)+B(B≠0)→B
Full
ClrDraw
AxesOn
I→Xmin
J→Xmax
K→Ymin
L→Ymax
ClrHome
Disp "θº:","Bº","ADJ:","OPP:","HYP:"
Output(1,4,θ)
Output(2,4,B)
Output(3,5,A)
Output(4,5,O)
Output(5,5,H)
```