Expressing cartesian unit vectors in terms of spherical unit vectors

This is driving me crazy, I just can't see how to do it. I want to express the cartesian unit vectors [tex]\hat{x}[/tex], [tex]\hat{y}[/tex] and [tex]\hat{z}[/tex] in terms of the spherical unit vectors [tex]\hat{r}[/tex], [tex]\hat{\theta}[/tex] and [tex]\hat{\phi}[/tex]. I have tried to do something similar in polar coordinates (just to make it a bit simpler for myself) but that didn't really help alot. I have figured out how to express the polar unit vectors in terms of cartesian ones:

... and I think I can do that for spherical coordinates too. But I can't see how to do it the other way around (polar to cartesian). If you could just help me do it for polar coords I think I will be able to adapt it to spherical.

You could do it geometrically if you can draw the pictures carefully. An arguably easier algebraic way to do it is to use the fact that, eg, [itex]\hat x = \nabla(x)[/itex], where x is the scalar function returning the x coordinate of a point (ie, the function f(x,y,z)=x). You can write this function in terms of r,[itex]\theta,\phi[/itex] using the formulas uart gave and then calculate the gradient in spherical coordinates. Of course, this is really a little circular, as you would usually use the expression for [itex]\hat x[/itex] in spherical coordinates to derive the form of the gradient in spherical coordinates.

This is driving me crazy, I just can't see how to do it. I want to express the cartesian unit vectors [tex]\hat{x}[/tex], [tex]\hat{y}[/tex] and [tex]\hat{z}[/tex] in terms of the spherical unit vectors [tex]\hat{r}[/tex], [tex]\hat{\theta}[/tex] and [tex]\hat{\phi}[/tex]. I have tried to do something similar in polar coordinates (just to make it a bit simpler for myself) but that didn't really help alot. I have figured out how to express the polar unit vectors in terms of cartesian ones:

... and I think I can do that for spherical coordinates too. But I can't see how to do it the other way around (polar to cartesian). If you could just help me do it for polar coords I think I will be able to adapt it to spherical.

Thanks!

Click to expand...

Your equations there for polar coords form a linear system with two equations and two unknowns. You can solve them for [itex]\hat{x}[/itex] and [itex]\hat{y}[/itex]. If you can set up the same type of system for spherical coords, then just do the same thing there (you'll have 3 eqns and 3 unknowns)!

This is a problem I have seen a lot on the internet, and no one seems to know what the asker is talking about. We want to know how to express the CARTESIAN unit vectors [tex]\hat{x}, \hat{y}, \hat{z}[/tex] in terms of the spherical coordinates r, [tex]\theta[/tex], and [tex]\phi[/tex] and their respective unit vectors.

The inverse, that is expressing [tex]\hat{r}, \hat{\theta}, \hat{\phi}[/tex] in terms of Cartesian unit vectors (but spherical coordinates!) is pretty popular. It's easy to find a reference online that shows:

(Note: gonna stop using LaTeX here, something's wrong with either my code or the compiler...)

But what about the other way around? Well, the above comments are on the right track: if you think about it, the gradient of a coordinate is a vector that points in the direction of increase of that coordinate axis. We know how to express z as a function of spherical coordinates. So, the gradient of z(r, theta, phi) is a vector that points in the z-hat direction.

Now we just need to normalize the vector. But wait! Recall that the magnitude of the gradient is just the "slope" of the scalar function along the direction of maximum increase. Well, think about the scalar function f(r, theta, phi) = z. That function is just a line along the z-axis, that increases at a rate of 1. So the gradient, in this case, is already normalized!

The main point: to find a Cartesian unit vector in terms of spherical coordinates AND spherical unit vectors, take the spherical gradient of that coordinate. For example (this is gonna be tough without LaTeX, but hopefully you will follow):

This is a problem I have seen a lot on the internet, and no one seems to know what the asker is talking about. We want to know how to express the CARTESIAN unit vectors [tex]\hat{x}, \hat{y}, \hat{z}[/tex] in terms of the spherical coordinates r, [tex]\theta[/tex], and [tex]\phi[/tex] and their respective unit vectors.

The inverse, that is expressing [tex]\hat{r}, \hat{\theta}, \hat{\phi}[/tex] in terms of Cartesian unit vectors (but spherical coordinates!) is pretty popular. It's easy to find a reference online that shows:

(Note: gonna stop using LaTeX here, something's wrong with either my code or the compiler...)

But what about the other way around? Well, the above comments are on the right track: if you think about it, the gradient of a coordinate is a vector that points in the direction of increase of that coordinate axis. We know how to express z as a function of spherical coordinates. So, the gradient of z(r, theta, phi) is a vector that points in the z-hat direction.

Now we just need to normalize the vector. But wait! Recall that the magnitude of the gradient is just the "slope" of the scalar function along the direction of maximum increase. Well, think about the scalar function f(r, theta, phi) = z. That function is just a line along the z-axis, that increases at a rate of 1. So the gradient, in this case, is already normalized!

The main point: to find a Cartesian unit vector in terms of spherical coordinates AND spherical unit vectors, take the spherical gradient of that coordinate. For example (this is gonna be tough without LaTeX, but hopefully you will follow):

Thanks for the LaTeX help, but note that the r's cancel in the [tex] \hat{\theta}[/tex] component of the final solution because the [tex] \hat{\theta}[/tex] component of the gradient in spehrical coordinates has a 1/r in it already. So the last line should read

And to clarify: you can do a similar thing with the other cartesian unit vectors:

1) Express the cartesian COORDINATE in spherical coordinates. (Essentially, we're "pretending" the coordinate is a scalar function of spherical variables.)
2) Take the gradient of the coordinate, using the spherical form of the gradient. That just IS the unit vector of that coordinate axis.

Hope this helps. It took me a while to figure it out, so maybe this will save some people some time.

This is not as rigorous as what tstin posted, but it is much faster :) Also makes it easy to relate the unit vectors in spherical polar and cylindrical coordinates, once you know their transformation matrix from Cartesian coord.

That's right... essentially, what I described above is the same as calculating the Jacobian, which is the matrix given by TAMEPLAH. A more rigorous description of coordinate transformations would involve a discussion of Jacobians and why they work and stuff.... that's for whoever's feeling ambitions (or understands those things, which I currently don't).