Find third triangle vertex given other 2 and lengths, without trigonometry

analytic geometrylinear algebratriangles

Problem setup
Given the coorinates of points A, B and lengths of all sides, point C should be found. I have a solution which relies on tangent equation and cosine rule

$φ_1 = \arctan2(B_y – A_y, B_x – A_x)$

$φ_2 = \arccos\left(\dfrac{l_1^2 + l_3^2 – l_2^2}{2\cdot l_1\cdot l_3}\right) $

$C = A + l_1\cdot[\cos(φ_1±φ_2)$; $\sin(φ_1±φ_2)]$

Where $A_x$, $A_y$, $B_x$, $B_y$ are the given coordinates and $l_1$, $l_2$, $l_3$ are lengths of $AC$, $BC$ and $AB$ respectively. The $±$ sign is present because two triangles can satisfy the problem.

Now, the issue with such solution is that this is a part of a bigger problem. I will have to substitute these equations into other equations which I will substitute into other equations… And in the end I'll have to find the invert function of the whole thing. Such solution gives several levels of nested trigonometric functions and inverting that is nearly impossible. That's why I'm looking for an algebraic solution which won't rely on trigonometry.

My attempt was to write down two circle equations:

$(C_x-A_x)^2+(C_y-A_y)=l_1^2$

$(C_x-B_x)^2+(C_y-B_y)=l_2^2$

Then i open the parentheses and get:

$C_x^2+C_y^2+A_x^2+A_y^2-2C_xA_x-2C_yA_y=l_1^2$

$C_x^2+C_y^2+B_x^2+B_y^2-2C_xB_x-2C_yB_y=l_2^2$

And then I don't really know what to do with that. I tried substracting one equation from another and got the dot product equation:

$A_x^2+A_y^2-B_x^2-B_y^2-2C_xA_x-2C_yA_y+2C_xB_x+2C_yB_y=l_1^2-l_2^2$

$C_x(B_x-A_x)+C_y(B_y-A_y)=\dfrac{l_1^2-l_2^2+|B|^2-|A|^2}{2}$

$C\cdot AB=\dfrac{l_1^2-l_2^2+|B|^2-|A|^2}{2}$

That isn't really helping. No idea how to derive the coordinates from that.

I'd really appreciate a solution without trigonometry. It can help me with the big problem I was trying to solve for a very long while, the six-bar linkage.

Best Answer

Let \begin{align} \hat u_x &= \frac{B_x - A_x}{l_3}, & \hat u_y &= \frac{B_y - A_y}{l_3},\\ \hat v_x &= -\hat u_y, & \hat v_y &= \hat v_x. \end{align} That is, $\hat u = (1/l_3) AB,$ so $\hat u$ is a unit vector in the direction $AB,$ and $\hat v$ is a unit vector orthogonal to $\hat u.$

Then $ C = A + (AC\cdot\hat u) \hat u \pm (AC\cdot\hat v) \hat v,$ where

\begin{align} AC\cdot\hat u &= \frac{AC \cdot AB}{l_3} = \lVert AC\rVert \cos\phi_2 = l_1 \left(\frac{l_1^2 + l_3^2 - l_2^2}{2 l_1 l_3}\right) = \frac{l_1^2 + l_3^2 - l_2^2}{2 l_3},\\ AC\cdot\hat v &= \lVert AC\rVert \sin\phi_2 = l_1 \sqrt{1 - \left(\frac{l_1^2 + l_3^2 - l_2^2}{2 l_1 l_3}\right)^2} = \frac{\sqrt{4 l_1^2 l_3^2 - (l_1^2 + l_3^2 - l_2^2)^2}}{2 l_3}. \end{align}

The $\pm$ sign represents the two possible placements for $C.$

While this derivation happens to mention a sine and cosine in passing, notice that there will be no trig functions in the final result. In fact, you could have gotten this result from your last equation with some inspiration and additional effort.

Another way to look at this is to consider the question How to plot a triangle, given three side lengths? In order to plot $A$ and $B$ in general position we have to use $\hat u$ and $\hat v$ as a basis for the coordinates found in the answers to that question.