Trilateration in 3D

"In geometry, trilateration is the process of determining absolute or relative locations of points by measurement of distances, using the geometry of circles, spheres or triangles.

In addition to its interest as a geometric problem, trilateration does have practical applications in surveying and navigation, including global positioning systems (GPS). In contrast to triangulation, it does not involve the measurement of angles."
Wikipedia

The trilateration can result zero, one or two solutions, in these cases trilaterate() will return null, an Object with { x, y, z } coordinates or an Array with two Objects with { x, y, z } coordinates, respectively.

There is an optional fourth parameter after the three points for trilaterate() for the case of two solutions to return the middle of them as one point.

In this example...

Note: the display of points and distances are projected to the X-Y plane so the Z coordinates cannot be seen, but they are taken into consideration by trilaterate()!