Law of Cosine isn't as used as Law of Sine, but it's pretty important when you're in a pinch. Let us get started.
Create a new program and name it "LOCS" (For Law Of CoSine)
Press "prgm", go to the "I/O" tab, and press "enter" on "ClrHome"
Press "prgm", go to the "I/O" tab, and press "enter" on "Input"
Type ""SIDE C OR ANGLE C (S OR A)"" then press comma
Press "vars", go to "String" and select "Str1". Start a new line
Press "prgm", go to the "I/O" tab, and select "If"
Grab "Str1". Press "2nd" "math" and select "="
Type ""S"" and start a new line
Get "Then" from the "CTL" tab (The first tab after pressing "prgm"). Start a new line
Repeat step 3 and type ""SIDE A: ",A". Start a new line
Repeat step 3 and type ""SIDE B: ",B". Start a new line
Repeat step 3 and type ""ANGLE C: ",C". Start a new line
Type "√(A²+B²-2ABcos(C))→D" and start a new line
Get "Disp" from the "I/O" tab, then type ""SIDE C: ",D". Start a new line
Get "End" from the "CTL" tab, then start a new line
Repeat steps 6 and 7, and type ""A"". Start a new line
Repeat step 9
Repeat step 10 and 11
Repeat step 3 and type ""SIDE C: ",C". Start a new line
Type "cos-1((C²-A²-B²)/(-2AB))→D"
Get "Disp" from the "I/O" tab, then type ""AwNGLE C: ",D". Start a new line
Repeat step 15 without starting a new line
Your code should look like:
:ClrHome
:Input "SIDE C OR ANGLE C (S OR A)",Str1
:If Str1="S"
:Then
:Input "SIDE A: ",A
:Input "SIDE B: ",B
:Input "ANGLE C: ",C
:√(A²+B²-2ABcos(C))→D
:Disp "SIDE C: ",D
:If Str1="A"
:Then
:Input "SIDE A: ",A
:Input "SIDE B: ",B
:Input "SIDE C: ",C
:cos-1((C²-A²-B²)/(-2AB))→D
:Disp "ANGLE C: ",D
:End
So that is the program, use it whenever you feel like it. Give this a like if it was helpful. Drop a comment if you have any questions or need help. Happy programming!
-Nate