A bit ago I finished a program grouping various previous things I've one. In this program, you can view a unit circle, input angles and find the trig funcs/inverses of that angle, and find the reference angle. Might update it with Deg to Rad and vice versa. Here's the code in 1kB!
Code:

Disp "1) UNIT CIRCLE"
Disp "2) MANUAL INPUT"
Disp "3) REFERENCE ANGLE"
Input "CHOOSE MODE: ",I
If I=1:Then
√(3)/2→U
√(2)/2→V
.5→W
ClrDraw
Degree
­12→Xmin
1.5→Xmax
­1→Ymin
1→Ymax
ZSquare
Circle(0,0,1,BLACK)
Line(0,0,1,0,GREEN)
Line(0,0,U,W,BLUE)
Line(0,0,V,V,RED)
Line(0,0,W,U,BLUE)
Line(0,0,0,1,GREEN)
Line(0,0,­W,U,BLUE)
Line(0,0,­V,V,RED)
Line(0,0,­U,W,BLUE)
Line(0,0,­1,0,GREEN)
Line(0,0,­U,­W,BLUE)
Line(0,0,­V,­V,RED)
Line(0,0,­W,­U,BLUE)
Line(0,0,0,­1,GREEN)
Line(0,0,W,­U,BLUE)
Line(0,0,V,­V,RED)
Line(0,0,U,­W,BLUE)
TextColor(BLUE)
"√(3)/2"→Str1
"√(2)/2"→Str2
"1/2"→Str3
"π/"→Str4
Text(2,2,"30°: ",Str4,"6, (",Str1,",",Str3,")")
TextColor(RED)
Text(14,2,"45°: ",Str4,"4, (",Str2,",",Str2,")")
TextColor(BLUE)
Text(26,2,"60°: ",Str4,"3, (",Str3,",",Str1,")")
Text(38,2,"120°: 2",Str4,"3, (­",Str3,",",Str1,")")
TextColor(RED)
Text(50,2,"135°: 3",Str4,"4, (­",Str2,",",Str2,")")
TextColor(BLUE)
Text(62,2,"150°: 5",Str4,"6, (­",Str1,",",Str3,")")
Text(74,2,"210°: 7",Str4,"6, (­",Str1,",­",Str3,")")
TextColor(RED)
Text(86,2,"225°: 5",Str4,"4, (­",Str2,",­",Str2,")")
TextColor(BLUE)
Text(98,2,"240°: 4",Str4,"3, (­",Str3,",­",Str1,")")
Text(110,2,"300°: 5",Str4,"3, (",Str3,",­",Str1,")")
TextColor(RED)
Text(122,2,"315°: 7",Str4,"4, (",Str2,",­",Str2,")")
TextColor(BLUE)
Text(134,2,"330°: 11",Str4,"6, (",Str1,",­",Str3,")")
Pause
End
If I=2:Then
ClrHome
0→M
While M≠1 and M≠2:
Disp "1) DEGREES"
Disp "2) RADIANS"
Input "INPUT METHOD (1/2): ",M
If M=1:
Degree
If M=2:
Radian
End
Input "ANGLE: ",θ
cos(θ)→B
sin(θ)→C
tan(θ)→D
1/cos(θ)→E
1/sin(θ)→F
1/tan(θ)→G
ClrHome
Output(1,1,"ANGLE: ")
Output(1,8,θ)
Output(2,1,"cos(θ): ")
Output(2,9,B)
Output(3,1,"sin(θ): ")
Output(3,9,C)
Output(4,1,"tan(θ): ")
Output(4,9,D)
Output(5,1,"sec(θ): ")
Output(5,9,E)
Output(6,1,"csc(θ): ")
Output(6,9,F)
Output(7,1,"cot(θ): ")
Output(7,9,G)
End
If I=3:Then
Input "VISUAL DISPLAY? Y/N: ",V
1→Y
0→N
If V=Y:Then
Degree
­10→Xmin
10→Xmax
Xmin→Ymin
Xmax→Ymax
ClrHome
Input "ANGLE: ",A
ClrDraw
cos(A)*20→B
sin(A)*20→C
Line(­10,0,10,0,RED)
Line(0,0,B,C,BLUE)
remainder(abs(A),360)→U
remainder(abs(A),180)→R
abs(180-R)→E
min(E,R)→R
If A<0:360-U→U
min(R,U)→R
cos(R)*20→X
sin(R)*20→Y
Line(0,0,X,Y,GREEN)
TextColor(NAVY)
Text(0,2,"ANG: ",A)
Text(15,2,"UNW: ",U)
TextColor(GREEN)
Text(30,2,"REF: ",R)
Pause
End
If V=N:Then
Input "ANGLE: ",A
ClrHome
A→B
Repeat B≥0
B+360→B
End
If B>360
remainder(B,360)→B
abs(180-B)→C
abs(B)→D
min(C,D)→R
ClrHome
Output(1,1,"ANGLE: ")
Output(1,8,A)
Output(2,1,"UNWOUND: ")
Output(2,10,B)
Output(3,1,"REF. ANG.: ")
Output(3,12,R)
Pause
End


I'm proud of how it turned out!

Edit: Is there any way to make the stuff in a menu? (Like instead of having it display "10, 2), etc. in that fashion, make it in a menu using the Menu( command [along with a quit function]?)
Here’s a Menu example. Put the Lbl statements in the correct spots in your code.


Code:

Lbl Z
Menu(“SELECT”,”UNIT CIRCLE”,A,”MANUAL INPUT”,B,”REFERENCE ANGLE”,C
Lbl A
Disp 111
Pause
Goto Z
Lbl B
Disp 222
Pause
Goto Z
Lbl C
Disp 333
Pause
Goto Z
dave1707 wrote:
Here’s a Menu example. Put the Lbl statements in the correct spots in your code.


Code:

Lbl Z
Menu(“SELECT”,”UNIT CIRCLE”,A,”MANUAL INPUT”,B,”REFERENCE ANGLE”,C
Lbl A
Disp 111
Pause
Goto Z
Lbl B
Disp 222
Pause
Goto Z
Lbl C
Disp 333
Pause
Goto Z


Thanks! I've decided to add more onto it, starting with a quit option. If I were to do submenus, do the labels have to be different from what's used on another menu?
You can have as many menus as you want and they can go to existing labels or new ones.
dave1707 wrote:
You can have as many menus as you want and they can go to existing labels or new ones.


Alright! Thanks for the tip!
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are GMT - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement