How can I calculate the dot product of two vectors if I know both dot products with a third vector? I have three vectors, $a$, $b$, and $c$ in $n$-dimensional space. I want to calculate $a\cdot b$. I know $\lvert a \rvert$, $\lvert b \rvert$, $\lvert c \rvert$, $a\cdot c$ and $b\cdot c$.
Is there a way to do this, preferably without using trig?
I have made some progress. If $\theta$ is the angle between $a$ and $c$, and $\phi$ is the angle between $b$ and $c$, I know that:
$$a\cdot b=\lvert a\rvert\lvert b\rvert\cos(\theta-\phi)=\lvert a\rvert\lvert b\rvert\cos\theta\cos\phi+\lvert a\rvert\lvert b\rvert\sin\theta\sin\phi$$
$$=\frac{(a\cdot c)(b\cdot c)}{\lvert c\rvert^2}+\lvert a\rvert\lvert b\rvert\sin\theta\sin\phi$$
I also know that 
$$\lvert a\rvert^2\lvert c\rvert^2\sin^2\theta=\lvert a\rvert^2\lvert c\rvert^2-(a\cdot c)^2$$ and likewise for $b$, but this doesn't give the sign of the sines.
I think this is possible, but I'm not sure how to do it.
Edit: Okay, I realize now that this is impossible generally. Is it possible in the two-dimensional case?
 A: In general, the answer is no.
$$a=(a_1,a_2,0)$$
$$b=(b_1,b_2,0)$$
$$c=(0,0,1)$$
So long as $a_1^2+a_2^2=1=b_1^2+b_2^2$, you will have $|a|=|b|=|c|=1$, and $a\cdot c=b\cdot c=0$.  However you can make $a\cdot b$ be anything you want (between $-1$ and $1$).
A: You cannot.
Take $a,b$ be two unit vectors in $\operatorname{span}(e_1,e_2)$ ($(e_i)_{1\leq i\leq n}$ being the standard orthonormal basis), and $c=e_3$.
Then $\langle a,c\rangle = \langle b,c\rangle = 0$, and you know $\lvert a\rvert = \lvert b\rvert= \lvert c\rvert =1$ by assumption, but $\langle a,b\rangle$ could take any value in $[-1,1]$.
A: In the two-dimensional case, of course. The dot products of a given vector with two linearly independent vectors determine its coordinates in some coordinate system (the system with those two vectors as basis). Take the rest from there.
A: A general result in linear algebra is that vectors $v_1,\ldots,v_n$ are linearly independent if and only if their Gramian matrix, i.e. the matrix of their scalar products, is invertible. In the case of two-dimensional vectors $a,b,c$, since they cannot be linearly independent, we get that
$det\begin{pmatrix}a\cdot a & a\cdot b & a\cdot c \\ a\cdot b & b\cdot b & b\cdot c \\ a\cdot c & b\cdot c & c\cdot c\end{pmatrix} = 0$.
You know all these entries except $a\cdot b$, and the above gives you a quadratic equation satisfied by it, leading to two possible solutions.
Unfortunately, the data you have is still not enough to uniquely determine $a\cdot b$. Consider the examples
$a_1 = \begin{pmatrix}0\\1\end{pmatrix},b_1 = \begin{pmatrix}1\\0\end{pmatrix},c_1 = \begin{pmatrix}1\\1\end{pmatrix}$
and
$a_2 = b_2 = \begin{pmatrix}1\\0\end{pmatrix},c_2 = \begin{pmatrix}1\\1\end{pmatrix}$.
In both cases you have $a_i\cdot c_i = b_i\cdot c_i = 1, |a_i|=|b_i|=1, |c_i|=\sqrt{2}$. In general, reflecting $a$ or $b$ with respect to the line given by $c$ changes none of your given data, but does change $a\cdot b$.
