i am 99% i got all my cases covered but i am still getting wrong answer (a computer program). obviously i am missing something. anyone if you could point it out that would be great.


i made tolerances so that when i test for equality, i am actually testing the absolute value of diff<0.0000001
first i made sure all the angles and sides are valid (ie between 0 and pi, for angles, and sides satisfy triangle inequality, sum of angles is pi)
if i have less than 3 known or i know the 3 angles only, thats invalid
if i know two angles, figure out the 3rd angle
if i know SAAA, then it must be a unique (of course, valid) triangle. cosine law figure out the other two sides
if i know AAASS, use sine law to check if the two known sides over the sin of two known angles equal. if they arent, invalid. if they are, figure out the 3rd side and quit.
if i know AAASSS, i do the sine law again like the above case by checking equality for all three sides.
if i know SSS, then its unique triangle
if i know SSSA or SSSAA, figure out the other angle(s) using cosine law and see if the 3 angles sum up to pi
finally if we have SAS, then unique
if we have ASS, so we have opposite knowns side x and angle X, and another known side y.
if y>=x and X>=pi/2
invalid
if (y>x and X<pi/2 and x<y*sinX)
invalid
if (y>x and X<pi/2 and x>y*sinX)
more than one solution
otherwise there is a unique solution. determine angle B
using sine law, the 3rd angle using sum of angles, and 3rd side using cosine law

thats it. what am i missing?