Triangle Solver is a program I wrote for my Pre-Calc class because I really
didn't feel like doing all the work, and besides, two of the kids in my class
had a triangle solver program for their HP48GXs so I figured "why shouldn't
there be one for the 85?"

	If you've been memorizing all those laws of cosines and the law of
sines, then this program could really help you.  This program will solve the
types of problems you get where you know 3 parts of the triangle (an angle
and two sides, all three sides, two angles and a side, or whatever) and you 
have to solve for the rest of them.  You just tell the calculator which case
the triangle is (SSS, SAS, ASA, AAS, or SSA <- yes there is a SSA property, 
also called  the ambigous case).  The calculator will then ask you for the 
measurements of the parts you know, then show a nice table of all the lengths of the sides, 
all the measurements of angles, and the area of the triangle also.  Before
entering the data, it helps to draw a picture of the triangle so you don't 
enter the wrong measurements for the wrong variables!  Some of the people in
my class keep saying "Gabe!  Your program is faulty!"  I keep telling them, 
"No!  The user is faulty!"  If you enter the variables correctly, you will 
get the right answer(s).  (In any case, the author takes no responsibility for 
any low grades in math)
	If you get a messed up screen with what looks like a bunch of complex
numbers, that means there is no such triangle.  In the SSA case, if there are
two answers, the calculator will show one table with one set of answers, then
another with the other set, then return you to the main menu.  If there is 
only one answer in the SSA case, it will only show you one answer.  If there
are no answers in the SSA case, it will say "No such triangle" then hit enter
to return to the main menu.
	If you accidentally press enter past the table screen, you can quit
the program, then run the program called "display" which shows the last 
values calculated without you having to enter in all the data again.  The 
program "display" is called by the program "triangle" whenever it shows 
answers.  The program you have to execute is "triangle".  If you think this
program is good, or if you find a bug, you can e-mail me at cyrax@ime.net.

PS- though it says beta 4, it may as well be final.  Feel free to make any
adjustments/improvements to this program, as long as you let me know what
you changed.  If you are one of those lamers who likes to put "written by"
in programs someone else wrote, go ahead, I really don't care, that's why
I didn't even put my name in it in the first place.

For those of you who are linkless, here is the text of both programs:

\START\
\COMMENT=Program file dated 12/02/95, 14:20
\NAME=TRIANGLE
\FILE=triangle.85P
Lbl START
ClLCD
Disp "   Triangle Solver"
Disp "        v1\LC-beta\4"
Menu(1,"SSS",SSS,2,"SAS",SAS,3,"ASA",ASA,4,"AAS",AAS,5,"More",MENUA)
Lbl MENUA
Menu(1,"Back",START,2,"SSA",SSA,5,"Quit",QUIT)
Lbl SSS
Input "Side A ",SIDEA
Input "Side B ",SIDEB
Input "Side C ",SIDEC
\cos^-1\ ((SIDEC\^2\-SIDEA\^2\-SIDEB\^2\)/(\(-)\2*SIDEA*SIDEB))\->\ANGL\#\
EC
\cos^-1\ ((SIDEB\^2\-SIDEA\^2\-SIDEC\^2\)/(\(-)\2*SIDEA*SIDEC))\->\ANGL\#\
EB
180-ANGLEB-ANGLEC\->\ANGLEA
DISPLAY
Goto START
Lbl SAS
Input "Side A ",SIDEA
Input "Side B ",SIDEB
Input "Angle C ",ANGLEC
\sqrt\(SIDEA\^2\+SIDEB\^2\-2*SIDEA*SIDEB*cos ANGLEC)\->\SIDEC
\cos^-1\ ((SIDEB\^2\-SIDEA\^2\-SIDEC\^2\)/(\(-)\2*SIDEA*SIDEC))\->\ANGL\#\
EB
\cos^-1\ ((SIDEA\^2\-SIDEB\^2\-SIDEC\^2\)/(\(-)\2*SIDEB*SIDEC))\->\ANGL\#\
EA
DISPLAY
Goto START
Lbl ASA
Input "Angle A ",ANGLEA
Input "Angle B ",ANGLEB
Input "Side C ",SIDEC
180-ANGLEA-ANGLEB\->\ANGLEC
(SIDEC/sin ANGLEC)*sin ANGLEA\->\SIDEA
(SIDEC/sin ANGLEC)*sin ANGLEB\->\SIDEB
DISPLAY
Goto START
Lbl AAS
Input "Angle A ",ANGLEA
Input "Angle B ",ANGLEB
Input "Side A ",SIDEA
180-ANGLEA-ANGLEB\->\ANGLEC
(SIDEA/sin ANGLEA)*sin ANGLEB\->\SIDEB
(SIDEA/sin ANGLEA)*sin ANGLEC\->\SIDEC
DISPLAY
Goto START
Lbl SSA
Input "Side A ",SIDEA
Input "Side B ",SIDEB
Input "Angle A ",ANGLEA
((2*SIDEB*cos ANGLEA)\^2\-(4*(SIDEB\^2\-SIDEA\^2\)))\->\BIG
If BIG<0
Goto NOANS
If BIG==0 or (2*SIDEB*cos ANGLEA-\sqrt\BIG)<0
Goto ONEANS
If BIG>0
Goto TWOANS
Lbl NOANS
ClLCD
Disp "  No such triangle"
Pause 
Goto START
Lbl ONEANS
(2*SIDEB*cos ANGLEA+\sqrt\BIG)/2\->\SIDEC
\sin^-1\ ((sin ANGLEA/SIDEA)SIDEB)\->\ANGLEB
180-ANGLEA-ANGLEB\->\ANGLEC
DISPLAY
Goto START
Lbl TWOANS
(2*SIDEB*cos ANGLEA+\sqrt\BIG)/2\->\SIDEC
\sin^-1\ ((sin ANGLEA/SIDEA)SIDEB)\->\ANGLEB
180-ANGLEA-ANGLEB\->\ANGLEC
DISPLAY
(2*SIDEB*cos ANGLEA-\sqrt\BIG)/2\->\SIDEC
\sin^-1\ ((sin ANGLEA/SIDEA)SIDEC)\->\ANGLEC
180-ANGLEA-ANGLEC\->\ANGLEB
DISPLAY
Goto START
Lbl QUIT
ClLCD
\STOP\

\START85\
\COMMENT=Program file dated 12/02/95, 14:20
\NAME=DISPLAY
\FILE=C:\WINLINK\DISPLAY.85P
:Lbl DISPLAY
:ClLCD
:(SIDEA+SIDEB+SIDEC)/2\->\S
:\sqrt\(S(S-SIDEA)(S-SIDEB)(S-SIDEC))\->\AREA
:round(AREA,6)\->\AREA
:round(ANGLEA,4)\->\ANGLEA
:round(ANGLEB,4)\->\ANGLEB
:round(ANGLEC,4)\->\ANGLEC
:round(SIDEA,4)\->\SIDEA
:round(SIDEB,4)\->\SIDEB
:round(SIDEC,4)\->\SIDEC
:Disp "  Sides      Angles"
:Disp "A","B","C","Area"
:Outpt(2,3,SIDEA)
:Outpt(3,3,SIDEB)
:Outpt(4,3,SIDEC)
:Outpt(2,14,ANGLEA)
:Outpt(3,14,ANGLEB)
:Outpt(4,14,ANGLEC)
:Outpt(5,6,AREA)
:Pause 
:Return
\STOP85\




