Yes, I see that.
My question is, how can I easily find the second solution?
Code:
C
..
. .
. .B
. ..
.. .
D .
. .
..
A
Impressive illustration, eh?
I know lengths AB and BD and the angle at A.
The law of cosines sometimes gives AD, sometimes AC.
I'm looking for AC which I know is longer than AB, so I know when I get the "false" solution AD.
My clumsy soultution now is to use the law of sinus to calculate one of the the angles at D (ADB) as ADB = arcsin(AB*sin(A)/BD).
I check that the solution is > 90 becuase the law of sinus too can give too solutions. If < 90, then the correct solution is 180 minus the result.
Then the other angle at D (BDC) is given by 180-ADB.
The angle at C is the same because triangle CBD is isosceles, BC = BD. Therefor angle CBD=180-2*BDC.
The length CD is given by the law of sinus as CD = BD*sin(CBD)/sin(C).
Finally, AC is given as AC = AD+CD.
So, now I wonder if maybe I'm a bit stupid here. Is there a much easier way to find the alternative solution AC when angle A, length AB and the "false" solution AD are known?
And I'm wondering how the computer decides which of the two possible soultions it presents. Is it prefering the short (and for me wrong) solution because it's lazy and wants to save memory?