# Dot product in spherical coordinates

1. Sep 18, 2011

### buttertop

1. The problem statement, all variables and given/known data
What is the dot product of two unit vectors in spherical coordinates?

2. Relevant equations
AB = ||A|| ||B|| cos($\theta$) = cos($\theta$)

3. The attempt at a solution

The above equation is the only relevant form of the dot product in terms of the angle $\theta$ that I can find. However, I'm not sure if the spherical coordinates need a term for $\phi$. If so, is this correct?

AB = ||A|| ||B|| cos($\theta$) sin($\phi$) = cos($\theta$) sin($\phi$)

Last edited: Sep 18, 2011
2. Sep 18, 2011

### glebovg

Unit vectors in spherical coordinates are

i = cos(φ)cos(θ)ρ + cos(φ)cos(θ)φ - sin(θ)θ
j = sin(φ)sin(θ)ρ + cos(φ)sin(θ)φ + cos(θ)θ
k = cos(φ)ρ - sin(φ)φ

3. Sep 18, 2011

### buttertop

Ah, sorry, by "unit vector" all I meant was both vectors have unit length, so ||A|| ||B|| = 1. Even if this didn't apply, I'm wondering if AB = ||A|| ||B|| cos($\theta$) sin($\phi$).

4. Sep 18, 2011

### glebovg

5. Sep 18, 2011

### glebovg

A spherical coordinate system is a coordinate system for three-dimensional space where the position of a point is specified by three numbers.

6. Sep 18, 2011

### buttertop

So if I have two vectors, they can each be described by the angles $\theta$ and $\phi$, roughly equivalent to the azimuth and the altitude of a sphere, right? So what I'd like to know is what the dot product is between two vectors in terms of these angles. I know, at least in cartesian coordinates, that the dot product is equal to ||A|| ||B|| cos($\theta$). If I'm describing the dot product of two vectors in three dimensional space, does this still apply, or do I need to take $\phi$ into account?

7. Sep 18, 2011

### glebovg

Like I said you need three numbers to describe a point in spherical coordinates, namely ρ, θ, and φ. θ and φ are not enough.

8. Sep 18, 2011

### buttertop

Ah, of course, sorry I misunderstood. In this case I believe $\rho$ is equal to 1. Is there a way to use the i, j and k identities you mentioned to express the dot product in terms of $\rho$, $\theta$ and $\phi$?

9. Sep 18, 2011

### glebovg

I do not understand your question. Perhaps you are talking about the cross product or the divergence. The divergence is like the dot product of the del operator and the vector function F. i.e. div F = F.

10. Sep 18, 2011

### buttertop

Hmm... I don't think the divergence is what I'm looking for exactly. Basically, this is the setup: there are two vectors centered on the origin. I know $\rho$, $\theta$ and $\phi$. How do I express the dot product of the two vectors in these terms?

11. Sep 18, 2011

### glebovg

Can you convert from spherical to Cartesian coordinates?

12. Sep 18, 2011

### glebovg

I think I know what you mean. Two compute <ρ1, φ1, θ1>⋅<ρ2, φ2, θ2> express spherical coordinates in terms of Cartesian coordinates (x, y, z) and use the fact that cos(θ1)cos(θ2) + sin(θ1)sin(θ2) = cos(θ1 - θ2).

13. Sep 18, 2011

### glebovg

Hint: <x1, y1, z1>⋅<x2, y2, z2> = ρ1sin(φ1)cos(θ12sin(φ2)cos(θ2) + ...

14. Sep 18, 2011

### buttertop

Thanks for all of your help glebovg, I think I'm on the right track. One thing though: I'd like to be able to express it in terms of the angles $\theta$ and $\phi$ between the two vectors, so there's only one value of $\theta$ and $\phi$ ($\rho$, too, but that is equal to 1 and won't show up, I believe).

Here is an example for two vectors in 2D, using $\theta$:
http://meandmark.com/vectorpart4.html" [Broken]

What would the equivalent be if I needed $\theta$ and $\phi$ to describe the two vectors?

Last edited by a moderator: May 5, 2017
15. Sep 18, 2011

### glebovg

If you are looking for an equivalent of ab = |a||b|cos(θ) just use the hint I gave you and you will derive the general formula.

Note that <x1, y1, z1>⋅<x2, y2, z2> = ab.