Trilateration

This online calculator solves the problem of trilateration - determining the coordinates of a point by the distance from that point to three other points with known coordinates.

This page exists due to the efforts of the following people:

Timur

Timur

Created: 2023-01-21 15:06:49, Last updated: 2023-04-02 14:29:26

The result of solving the problem can be one of three:

  1. There is no point the distances from which to the other three correspond to the given ones
  2. There is exactly one point, the distances from which to the other three correspond to the given ones.
  3. There are two points whose distances to the other three correspond to the given ones

Calculation formulas and illustrations for each case are given below the calculator.

PLANETCALC, Trilateration

Trilateration

Result
 
Solutions
 
Digits after the decimal point: 2

Trilateration

The locus of points lying at a given distance r from a point with coordinates (x, y, z) is the surface of a sphere of radius r with the center at point (x, y, z). Thus, from the point of geometry, the problem of trilateration is to find the coordinates of the intersection of three spheres. These coordinates are found by solving a system of equations based on the following reasoning1:
Each pair of spheres intersect in a circle. Its center is on a straight line connecting the centers of the spheres. The circle itself lies in a plane perpendicular to that line. Consider three spheres: sphere 1 with radius r1 centered at the point O1(x1, y1 >, z1), sphere 2 with radius r2 centered at point O2(x2, y2, z2) and sphere 3 with radius r3 centered at O3 >(x3, y3, z3).

The equation of the plane in which the circle formed by the intersection of spheres 1 and 2 lies is as follows:
(x_2-x_1)x+(y_2-y_1)y+(z_2-z_1)z=\frac{1}{2}(x_2^2-x_1^2+y_2^2-y_1^2+z_2^2-z_1^2+r_1^2-r_2^2)
The equation of the plane in which the circle formed by the intersection of spheres 1 and 3 lies is as follows:
(x_3-x_1)x+(y_3-y_1)y+(z_3-z_1)z=\frac{1}{2}(x_3^2-x_1^2+y_3^2-y_1^2+z_3^2-z_1^2+r_1^2-r_3^2)
The equation of the plane of the triangle formed by the centers of the spheres:
((y_{3}-y_{1})(z_{2}-z_{1})-(y_{2}-y_{1})(z_{3}-z_{1}))(x-x_{1})+((z_{3}-z_{1})(x_{2}-x_{1})-(z_{2}- z_{1})(x_{3}-x_{1}))(y-y_{1})+((x_{3}-x_{1})(y_{2}-y_{1})-(x_{2}-x_{1})(y_{3}-y_{1}))(z-z_{1})=0
The intersection of the first two planes gives a line perpendicular to the last plane. The intersection of this line with the plane of the triangle is the perpendicular from the desired point of intersection of the spheres to the plane of the triangle formed by the centers of the spheres. This intersection point belongs to all three planes, and its coordinates are the solution of the system of three linear algebraic equations given above.

Having solved this system, we obtain the coordinates of the point O (x0, y0, z0).
Then the coordinates of the intersection point of the three spheres are determined by the following formulas:
{\displaystyle {\begin{cases}x=x_{0}+k((y_{3}-y_{1})(z_{2}-z_{1})-(y_{2}-y_{1})(z_{3}-z_{1}))\\y=y_{0}+k((z_{3}-z_{1})(x_{2}-x_{1})-(z_{2}-z_{1})(x_{3}-x_{1}))\\z=z_{0}+k((x_{3}-x_{1})(y_{2}-y_{1})-(x_{2}-x_{1})(y_{3}-y_{1}))\\k=\pm {\frac {\sqrt {r_{1}^{2}-|OO_{1}|^{2}}}{2S_{O_{1}O_{2}O_{3}}}}\\\end{cases}}}

The expression for calculating k determines the number of solutions. If the difference under the square root is positive, then we have two solutions (+k, -k) - two intersection points of the three spheres, illustrated by the picture below

Example of two intersections
Example of two intersections



If the difference under the root is zero, then we have exactly one point of intersection of two spheres:

Example of one intersection
Example of one intersection



Finally, if the expression under the root is negative, then there are no solutions - the spheres do not intersect

Example of no intersections
Example of no intersections

URL copied to clipboard
PLANETCALC, Trilateration

Comments