Misc Calc programs for pre-calculus:
(use this to open calc files)
Finding the Angle Between Two Vectors
This program will graph two vectors and calculate the measure of the angle between the vectors. Be sure to set an appropriate viewing window. After the vectors are drawn, press "Enter" to view the angle between the vectors.
:ClrHome
:Degree
:Disp “ENTER (A,B)”
:Input “ENTER A”,A
:Input “ENTER B”,B
:ClrHome
:Disp “ENTER (C,D)”
:Input “ENTER C”,C
:Input “ENTER D”,D
:Line(0,0,A,B)
:Line(0,0,C,D)
:Pause
:AC+BD→E
: Sqr(A^2+B^2)→U
: Sqr(C^2+D^2)→V
:cos-1(E (UV))→Z
:ClrDraw:ClrHome
:Disp “angle=”,Z
:Stop
(there are a TON of more potential vector programs, but vectors are really easy so ¯\_(ツ)_/¯)
LAW OF COSINE
Menu("Law of cosine","No side A",A,"No side B",B,"No side C",C,"No angle C",D)
Lbl C
Prompt A,B,D
sqrt(A^2+B^2-2ABcos(D))->C
Disp "C IS",C
Stop
Lbl D
Prompt A,B,C
cos^-1((C^2-A^2-B^2)/((~2)AB))->D
Disp "Angle is",D
Stop
Lbl A
Prompt B,C,D
If (B^2(cos(D))^2-B^2+C^2)<0
Then
Disp "No such triangle
Else
(Bcos(D)+sqrt(B^2(cos(D))^2-B^2+C^2)->P
(Bcos(D)-sqrt(B^2(cos(D))^2-B^2+C^2)->Q
Disp "SIDE POSSIBILITIES",P,Q
Stop
Lbl B
Prompt A,C,D
If (A^2(cos(D))^2-A^2+C^2)<0
Then
Disp "No such triangle
Else
(Acos(D)+sqrt(A^2(cos(D))^2-A^2+C^2)->R
(Acos(D)-sqrt(A^2(cos(D))^2-A^2+C^2)->S
Disp "SIDE POSSIBILITIES",R,S
Stop
LAW OF SINE:
ClrHome
Menu("WHAT?","ANGLE B",Z,"SIDE B",Y)
Lbl Z
Input "SIDE A= ",A
Input "ANGLE A= ",B
Input "SIDE B= ",C
Disp "","","ANGLE B="
(sin^-1(Csin(B)/A))->Y
Disp Y
Disp "Or", 180-Y
Pause
ClrHome
Lbl Y
Input "SIDE A= ",A
Input "ANGLE A= ",B
Input "ANGLE B= ",C
Disp "","","SIDE B=",Asin(C)/sin(B)
Pause
ClrHome
Convert between radians and degrees
Radian
ClrHome
Menu("CONVERSION","Rad -> Deg",A,"Deg -> Rad",B)
Lbl A
Input "Radian: ",A
(180A/pi)->A
ClrHome
Output(1,1,A
Output(2,1,"degrees
Pause
ClrHome
Lbl B
Input "Degrees: ",A
ClrHome
(A/180)->B
Disp B>Frac (Math, 1)
Output(2,16,"pi
Output(4,10,"degrees
Pause
ClrHome
Finding triangle area SAS
Pause "INPUT SAS
Input "adj side: ",A
Input "angle: ", B
Input "adj side 2: ", C
((ACsin(B))/2)->D
Disp "AREA", D
Pause
ClrHome
Stop
Finding triangle area SSS
Pause "INPUT SIDES"
Prompt A,B,C
((A+B+C)/2)->D
(Sqr(D(D-A)(D-B)(D-C)))->E
Disp "Area", E
Pause
ClrHome
Stop