I have 3 components, $r$, $\theta$ and $\phi$, for an electric field in spherical coordinates (and the $\phi$ component happens to be zero), let's say I just want to convert the $r$ component into cartesian, which looks like:

$$ -\frac{0.058125 \cos\theta\sin^2\theta}{r^3} $$

How do I convert this into cartesian?

Edit: Sorry maybe I should have explained that this expression is one component of a vector, which I got using E= −∇V

  • $\begingroup$ See this: en.wikipedia.org/wiki/Gradient $\endgroup$ – lucas Apr 19 '16 at 6:53
  • $\begingroup$ don't forget about the unit vector - maybe you intend to transform that too. $\endgroup$ – anon01 Apr 19 '16 at 14:19

You said this is the $r$-component, then you've missed the $\hat{\bf r}$.

Use $$r=\sqrt{x^2+y^2+z^2}$$ $$\cos\theta=z/r=\frac{z}{\sqrt{x^2+y^2+z^2}}$$ $$\hat{\bf r}=\frac{x\hat{\bf x}+y\hat{\bf y}+z\hat{\bf z}}{r}$$

  • $\begingroup$ what if I had a sin(phi) or cos(phi) in the expression? $\endgroup$ – user43783 Apr 19 '16 at 7:49
  • $\begingroup$ Use $\tan\phi=y/x$. $\endgroup$ – velut luna Apr 19 '16 at 8:07

Assuming that $\theta$ is the polar angle (angle between $\vec r$ and $\hat z$) and $\phi$ the azimuthal angle then the following relationships can be used.

$x = r \;\sin \theta \;\cos \phi$
$y = r \;\sin \theta\;\sin \phi$
$z= r\; \cos \theta$

  • $\begingroup$ these aren't very helpful as written - you need the inverted relations $\endgroup$ – anon01 Apr 19 '16 at 14:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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