8
$\begingroup$

For two vectors $p_1=(r_1,\theta_1, \phi_1)$ and $p_2=(r_2, \theta_2, \phi_2)$ I want the dot product $p_1\cdot p_2$. However, the solutions I have seen, involve finding the components in Cartesian coordinates and using them to get the dot product e.g., $$p_1\cdot p_2= r_1r_2\sin{\theta_1}\cos{\phi_1}\sin{\theta_2}\cos{\phi_2} +r_1r_2\sin{\theta_1}\sin{\phi_1}\sin{\theta_2}\sin{\phi_2} +r_1r_2\cos{\theta_1}\cos{\theta_2}$$ My question is, is it necessary to convert to Cartesian? I thought that in spherical polar the dot product would be: $p_1\cdot p_2=(r_1r_2+\theta_1\theta_2+\phi_1\phi_2).$ It gives the wrong answer, so I know I am going wrong but not sure where. So, where I go wrong?

$\endgroup$

3 Answers 3

8
$\begingroup$

The formula $$ \sum_{i=1}^3 p_i q_i $$ for the dot product obviously holds for the Cartesian form of the vectors only. The proposed sum of the three products of components isn't even dimensionally correct – the radial coordinates are dimensionful while the angles are dimensionless, so they just can't be added.

One can't simplify the calculation much. At most, one may realize that the inner product will only depend on $\phi_1,\phi_2$ through their difference $\phi_1-\phi_2$ because one may use the rotational symmetry around the $z$-axis to set e.g. $\phi_2$=0.

While doing so, we may set $\phi_2=0$ i.e. $y_2=0$ and the inner product reduces to $$ x_1 x_2 + z_1 z_2 = r_1r_2 (\sin\theta_1\sin\theta_2 \cos\phi_1 + \cos\theta_1\cos\theta_2) $$ We may restore the form for a general rotation by replacing $\phi_1$ in the formula above by $\phi_1-\phi_2$ to get the inner product $$ r_1r_2 (\sin\theta_1\sin\theta_2 \cos(\phi_1-\phi_2) + \cos\theta_1\cos\theta_2) $$ which is the same as your formula because $\cos(a-b)=\cos a\cos b +\sin a \sin b$.

$\endgroup$
2
  • 2
    $\begingroup$ thanks for taking time to answer. very useful. I was surprised that I had find the components of the vector in Cartesian coordinates in order to calculate the dot product. I was hoping that the I could stay in spherical polar coordinates. $\endgroup$
    – dkmax
    Commented May 31, 2016 at 19:04
  • $\begingroup$ You can calculate the dot product in the polar coordinates but you have to use the correct formula and the correct formula is what both of us wrote, not $r_1 r_2+ \theta_1\theta_2+\dots$ or something like that. $\endgroup$ Commented Jun 1, 2016 at 3:28
6
$\begingroup$

Notice that the radius vector of a point in space with spherical coordinates $r,\theta,\phi$ can be written as $$\mathbf{r}=r\mathbf{\hat{r}}(\theta,\phi),$$ where $$\mathbf{\hat{r}}(\theta,\phi)=\sin\theta\cos\phi\mathbf{\hat{x}}+\sin\theta\sin\phi\mathbf{\hat{y}}+\cos\theta\mathbf{\hat{z}}.$$ Thus the components of the radius vector with respect to the "spherical basis" $(\mathbf{\hat{r}}(\theta,\phi),\boldsymbol{\hat{\theta}}(\theta,\phi),\boldsymbol{\hat{\phi}}(\theta,\phi))$ AT THE POINT with spherical coordinates $(r,\theta,\phi)$ (it is VERY important to realize that the spherical unit vectors are really vector fields, they vary from point to point!) are NOT $(r,\theta,\phi)$. Instead, they are $(r,0,0)$! Indeed, $\theta$ and $\phi$, having no physical dimension, cannot be the components of a vector.

When $r_1,\theta_1,\phi_1$ and $r_2,\theta_2,\phi_2$ are known for two vectors $\mathbf{p}_1,\mathbf{p}_2$, we have $$\mathbf{p}_1=r_1\mathbf{\hat{r}}(\theta_1,\phi_1)\quad\text{and}\quad\mathbf{p}_2=r_2\mathbf{\hat{r}}(\theta_2,\phi_2).$$ (With respect to the spherical basis, we are forced to use different unit vectors $\mathbf{\hat{r}}(\theta_1,\phi_1)$ and $\mathbf{\hat{r}}(\theta_2,\phi_2)$! This is a striking difference between cartesian coordinates and spherical coordinates.) Hence: \begin{align} \mathbf{p}_1\cdot\mathbf{p}_2&=\left[r_1\mathbf{\hat{r}}(\theta_1,\phi_1)\right]\cdot\left[r_2\mathbf{\hat{r}}(\theta_2,\phi_2)\right]\\ &=r_1r_2\mathbf{\hat{r}}(\theta_1,\phi_1)\cdot\mathbf{\hat{r}}(\theta_2,\phi_2)\\ &=r_1r_2\left(\sin\theta_1\cos\phi_1\mathbf{\hat{x}}+\sin\theta_1\sin\phi_1\mathbf{\hat{y}}+\cos\theta_1\mathbf{\hat{z}}\right)\cdot\left(\sin\theta_2\cos\phi_2\mathbf{\hat{x}}+\sin\theta_2\sin\phi_2\mathbf{\hat{y}}+\cos\theta_2\mathbf{\hat{z}}\right)\\ &=r_1r_2\left(\sin\theta_1\sin\theta_2\cos\phi_1\cos\phi_2+\sin\theta_1\sin\theta_2\sin\phi_1\sin\phi_2+\cos\theta_1\cos\theta_2\right)\\ &=r_1r_2\left[\sin\theta_1\sin\theta_2\cos(\phi_1-\phi_2)+\cos\theta_1\cos\theta_2\right]. \end{align} This is the formula you have given in your post. When we put $r_1=r_2=1$ and call $\omega$ the angle between $\mathbf{p}_1$ and $\mathbf{p}_2$, we get a fairly established formula, namely $$\cos\omega=\sin\theta_1\sin\theta_2\cos(\phi_1-\phi_2)+\cos\theta_1\cos\theta_2$$ since $\mathbf{p}_1\cdot\mathbf{p}_2=r_1r_2\cos\omega=\cos\omega$.

EDIT: never mind, your question ended up at the top of the list because someone recently edited your OP. My bad for not noticing the 2016 date in due time ...

$\endgroup$
2
$\begingroup$

You can write the dot product of two vectors $p,q$ in the form $\sum_{ij} p_i A_{ij} q_j$ where the matrix $A$ is a kind of "metric" that defines the inner product. In cartesian 3D coordinates this metric is a diagonal matrix, $A = \text{diag}(1,1,1)$, but in the spherical coordinates it takes a different form (and depends on position).

$\endgroup$
2
  • $\begingroup$ Should one transform the metric like a covariant tensor to end up with the formula? $\endgroup$
    – Emil
    Commented Jun 25, 2020 at 6:58
  • $\begingroup$ Precisely. And in the case of Euclidean metric in the Cartesian basis, the transformation is rather simple, given by $J^T J$ of the basis transformation, see en.wikipedia.org/wiki/Metric_tensor#Euclidean_metric. The metric is useful since it also gives you immediately the volume element, if one needs to do integration. $\endgroup$
    – physics
    Commented Jun 27, 2020 at 0:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.