TITLE: Given the pairwise distances between $n$ points, how can I find plausible coordinates for the points?
QUESTION [3 upvotes]: If I have three points $A, B, C$, and I know the distances between $A$ and $B$, $B$ and $C$, and $A$ and $C$,
(1) How can I find (one possible value for) the coordinates of $A$, $B$, and $C$?
(2) If the distance function is a viable distance metric, must a solution always exist?
(3) How can I generalize this to $n$ points?

REPLY [0 votes]: Denote the distances $AB, BC, AC$ as $p,q,r$ respectively. Let's work in $\mathbb R^n$, with the Euclidean Metric.
Place $A$ at the origin $(0,0,0,\cdots,0)$, without loss of generality. 
 Place $B$ on the positive $x_1$-axis at the known distance from $A$.So, it's coordinates are $ (p,0, \cdots ,0)$
Let the coordinates of $C$ be $(x_1,x_2 \cdots, x_n)$.
Then we have the equations $$\sum_{i=1}^n x_i^2=r^2, \text{ and } (x_1- p)^2+\sum_{i=2}^nx_i^2=q^2,$$ from the distances we know and the usual euclidean distance formula in $\mathbb R^n$.
Some algebra reduces this to the single equation $(x_1- p)^2 +r^2-x_1^2=q^2$ and so, $x_1 = \frac{p^2+q^2-r^2}{2p}$. 
In $2$-dimensions, you get two values for the y-coordinate, one above the $x$-axis and one below it. But in higher dimensions, after substituting the value of $x_1$ (That we just determined) into $\sum_{i=1}^n x_i^2=r^2$, this yields the locus of all possible locations for the third point $C$. After this, all translations, rotations and reflections( Which are represented by invertible$n \times n$ matrices), yields all possible embeddings (Or placements) of the triangle in $\mathbb R ^n$.
{"set_name": "stack_exchange", "score": 3, "question_id": 181169}