Answer to your question: Use a matrix.
Also,
Is this what your looking for?
Btw, I'm using the arrow keys to navigate between each window. (Up-Down for angles & Left-Right for trig ratios)
Here's the full blown-code (un-optimized of course):
Code:
Degree :ClrHome
{16,6}->dim([A]
{0,30,45,60,90,120,135,150,180,210,225,240,270,300,315,330}->L1
If [A](2,1)=0.5:Goto A
"sin(X)cos(X)tan(X)"->Str0
Fix 0
For(A,1,3)
For(B,1,16)
Output(1,1,"Building Assets...")
Output(2,1,(A*16+B)/64*100)
Output(2,4,"%")
sub(Str0,(A-1)*3+1,3->{Y1}
If (B=5 and A=3) or (B=13 and A=3)
Then
5->[A](B,A)
0->[A](B,A+3)
Goto 0
Else
{Y1}(L1(B)->[A](B,A)
End
If 0!={Y1}(L1(B)
Then
1/{Y1}(L1(B)->[A](B,A+3)
Else
5->[A](B,A+3)
End
Lbl 0
End
End
Lbl A
"sincostancscseccot"->Str0
0->C:0->D
AxesOff:ClrHome:FnOff
Lbl AA
ClrDraw
TextColor(Blue)
Text(5,60+5,sub(Str0,3(C+1)-2,3))
Text(5,2*60+5,sub(Str0,3(C+2)-2,3))
Text(5,3*60+5,sub(Str0,3(C+3)-2,3))
For(A,1,3)
For(B,1,8)
TextColor(Black)
If [A](B+D,A+C)=5
Then
Text(B*15+5,A*60+5,"und"
Else
Text(B*15+5,A*60+5,round([A](B+D,A+C),3))
End
TextColor(Blue)
Text(B*15+5,5,L1(B+D))
End
End
Repeat K!=0
getKey->K
End
If K=24:0->C
If K=25:0->D
If K=26:3->C
If K=34:8->D
If K=45:Goto Q
Goto AA
Lbl Q
ClrHome
Note that you have to "build the assets" the first time you run the program (or after any RAM resets). This simply creates the matrix in which all the trig values are stored. I could have built it manually but I figured that it might be more convenient for the program to build it instead (since the matrix will be deleted in RAM resets, etc.).
Also: Degrees?
I swear the only place you ever see radians is in math. Physics or anywhere else, it's degrees. Nevertheless, I suggest you use radians instead of degrees in the program. I can still hear my Calculus teacher telling me "No, Josiah, not 45°, π/4 radians."