TITLE: Reconstructing vectors from inner products
QUESTION [7 upvotes]: Suppose that I have two unknown vectors $v_1,v_2 \in \mathbb{R}^3$, and a known vector $v_{3} \in \mathbb{R}^3$. I know all inner products $\langle v_i, v_j \rangle$, $1 \leq i,j \leq 3$. Is there a closed-form (or least painful iterative) way to reconstruct $v_1$ and $v_2$? intuitively it looks like there might be two solutions since any $v_1$ and $v_2$ can be reflected through the known $v_3$ to get the same inner products. Nevertheless getting them both would be helpful. Note that the problem is not generally rotation invariant as $v_3$ is known.

REPLY [2 votes]: Assuming the vectors are in general position, i.e. no two are parallel:
Select an arbitrary unit vector $t$ perpendicular to $v_3$ (the usual trick for doing so robustly is to take $t = (e\times v_3)/\|e\times v_3\|$, where $e$ is the vector with a 1 in the entry corresponding to the least-magnitude entry of $v_3$, and a 0 elsewhere.)
We can assume
$$v_1 = \alpha_1 t + \beta_1 v_3$$
$$v_2 = \alpha_2 t + \beta_2 v_3 + \gamma_2 t\times v_3$$
Now
$$\beta_1 = v_1\cdot v_3 / \|v_3\|^2$$
$$\alpha_1 = \sqrt{\|v_1\|^2 -\beta_1^2\|v_3\|^2}$$
$$\beta_2 = v_2\cdot v_3 / \|v_3\|^2$$
$$\alpha_2 = \frac{v_1\cdot v_2 - \beta_1 v_2\cdot v_3}{\alpha_1}$$
$$\gamma_2 = \pm \sqrt{\frac{\|v_2\|^2 -\alpha_2^2 - \beta_2^2\|v_3\|^2}{\|v_3\|^2}}.$$
The answer is of course only unique up to (1) selection of $t$ and (2) selection of the sign of $\gamma_2$, i.e. the handedness of the resulting $(v_1,v_2,v_3)$ coordinate frame. There are two smooth families of solutions.