Recovering the third internal barycentric distance from a 3-point triangle and two internal distances

72 Views Asked by At

I am trying to solve the following problem:

enter image description here

Essentially, I have three points that represent a triangle embedded on a 2D plane, and a pair of scalar distances that describe the distance from two of those points to a forth (unknown) point. I am trying to calculate the distance of the dashed line, specifically so I can convert all three distances into a set of barycentric coordinates to recover the 4th point position without having to resort to using trig (if at all possible).

I realize that there would technically be two solutions to this problem, though I'm looking for the one with the shortest distance to the third point.

Is there easy way of achieving this? I know it'd be pretty trivial to do simply by working out the position of the 4th point using trig and calculating the distance between that and the third point, but I was wondering if there was some other way of accomplishing this instead.

2

There are 2 best solutions below

0
On BEST ANSWER

Since it's always possible to express the coordinates of the four points as follows:

$$ A(0,0), \quad \quad \quad B(x_b,y_b), \quad \quad \quad C(x_c,y_c), \quad \quad \quad D = C + d_3(\alpha,\beta) $$

it's sufficient to solve a system of polynomial equations:

$$ \begin{cases} \overline{AD}^2 = d_1^2 \\ \overline{BD}^2 = d_2^2 \\ \alpha^2 + \beta^2 = 1 \\ \end{cases} \quad \quad \quad \Leftrightarrow \quad \quad \quad \begin{cases} d_3 = \dots \\ \alpha = \dots \\ \beta = \dots \\ \end{cases} $$

which will have $0$, $2$ or $4$ real solutions, among which those for which $d_3>0$ are acceptable.

0
On

An even more direct way is to use the Cayley-Menger determinant formula, as used in my answer to your similar question here, with $a=BC,b=CA,c=AB,d=DA,e=DB$ and where $x=DE$ is the unknown :

$$\begin{vmatrix} 0 & 1 & 1 & 1 &1 \\ 1 & 0 & c^2 & b^2 & u^2 \\ 1 & c^2 & 0 & a^2 & v^2 \\ 1 & b^2 & a^2 & 0 &x^2 \\ 1 & u^2 & v^2 & x^2& 0 \end{vmatrix}=0$$

Therefore $x$ is a solution to a biquadratic equation, that is easily solved.