I am solving basically the same problem as asked in this thread Determine third point of triangle when two points and all sides are known? I know 3 sides of a triangle and positions of two of them. And I need to determine the coordinates of the last point.
For example:
|AB| = 3
|AC| = 4
|BC| = 5
A(0,0)
B(3,0)
C(?,?)
However, I need a general solution to apply it in my program code. I know it is pretty easy to calculate this on the paper by solving the first equation and then using the result in the other equation:
$$1.\ \ \ \ \ \ (C_x - B_x)^2 + (C_y - B_y)^2 = |BC|^2$$ $$2.\ \ \ \ \ \ (C_x - A_x)^2 + (C_y - A_y)^2 = |AC|^2$$
When I try to calculate a general solution $C_x = ?$ and $C_y = ?$, I'm getting a terribly complicated equation and I can't reach the end.
I got to this point:
$$C_x = B_x \pm \sqrt{|BC|^2 - B_y^2 + 2B_yC_y - C_y^2}$$
and then when I try to put this equation to the second one I get this:
$$B_x^2 - B_y^2 + A_x^2 + A_y^2 + |BC|^2 - |AC|^2 + 2B_yC_y - 2A_xB_x - 2C_yA_y - 2A_x\sqrt{|BC|^2 - B_y^2 + 2B_yC_y - C_y^2} + 2B_x\sqrt{|BC|^2 - B_y^2 + 2B_yC_y - C_y^2} = 0$$
Is it really that complicated or am I making a mistake somewhere? I'm not a mathematical freak but I assume that there are only two possible solutions.
When I tried to input these equations into Wolfram Alpha I'm getting several different results, each spanning up to several lines :-((