How to Do Trilateration?

571 Views Asked by At

Trilateration is the process of calculating the coordinates of a point by using its distances to three other points.

Say that, we have three points of which we know the coordinates:
$A(A_x, A_y)$
$B(B_x, B_y)$
$C(C_x, C_y)$

And we want to find the coordinates of a fourth point
$D(D_x,D_y)$

The distances $|AD|, |BD|, |CD|$ are known.

When I write the equations,

$(D_x-A_x)^2 + (D_y-A_y)^2-|AD|^2 = 0$
$(D_x-B_x)^2 + (D_y-B_y)^2-|BD|^2 = 0$
$(D_x-C_x)^2 + (D_y-C_y)^2-|CD|^2 = 0$

Subtracting first two, I get

$A_x^2 - B_x^2 + A_y^2 - B_y^2 + |BD|^2 - |AD|^2 + 2D_x(B_x-A_x) + 2D_y(B_y-A_y) = 0$

$2D_x(B_x-A_x) + 2D_y(B_y-A_y) = - A_x^2 + B_x^2 - A_y^2 + B_y^2 - |BD|^2 + |AD|^2$

$D_x(B_x-A_x) + D_y(B_y-A_y) = \dfrac{- A_x^2 + B_x^2 - A_y^2 + B_y^2 - |BD|^2 + |AD|^2}{2}$

$D_x = \dfrac{\dfrac{-A_x^2 + B_x^2 - A_y^2 + B_y^2 - |BD|^2 + |AD|^2}{2} - D_y(B_y - A_y)}{B_x-A_x}$

I stuck right here. What should I do to go on?

1

There are 1 best solutions below

0
On

Using your approach, you have basically found a line $aD_x+bD_y=c$ on which $D$ has to lie, and you have derived that from the distances to $A$ and $B$ without using $C$. Do the same for a different pair of known points and you obtain a second line. Intersect them and you have $D$. At least if your data is consistent. Otherwise you might want to do the third pair as well, and then somehow combine the results, by averaging them or by finding the most trustworthy one.