1
$\begingroup$

How do you recenter a spherical coordinate system. For example, if the center were at $\left (0, 0, 0 \right )$ and I wanted to move the center of the spherical coordinate system to $\left (\rho_{1}, \Theta_{1}, \Phi_{1} \right )$, then what transformation would I apply to $\left (\rho_{2}, \Theta_{2}, \Phi_{2} \right )$?

In cartesian coordinates, you would simply subtract the two vectors.

$\endgroup$
2
  • 3
    $\begingroup$ How about converting to cartesian, translating, then converting back? $\endgroup$ – Jonas Meyer Jan 9 '10 at 3:19
  • $\begingroup$ What Jonas suggested is essentially what Mariano's code below does. $\endgroup$ – Michael Lugo Jan 9 '10 at 15:36
5
$\begingroup$

This is going to be unsightly...

The following Mathematica code:

Needs["VectorAnalysis`"]
Simplify@ CoordinatesFromCartesian[
 CoordinatesToCartesian[{r, theta, phi}, Spherical] 
                     + CoordinatesToCartesian[{r0, theta0, phi0}, Spherical],
 Spherical
 ] 

gives the following output (doctored so that it looks nicer):

$$ r' = \sqrt{r^2+2 r_0 r \left(\sin (\theta ) \sin \left(\theta _0\right) \cos \left(\phi -\phi _0\right)+\cos (\theta ) \cos \left(\theta _0\right)\right)+r_0^2} $$

$$ \theta' = \cos ^{-1}\left(\frac{r \cos (\theta )+r_0 \cos \left(\theta _0\right)}{\sqrt{r^2+2 r_0 r \left(\sin (\theta ) \sin \left(\theta _0\right) \cos \left(\phi -\phi _0\right)+\cos (\theta ) \cos \left(\theta _0\right)\right)+r_0^2}}\right) $$

$$ \phi' = \tan ^{-1}\left(r \sin (\theta ) \cos (\phi )+r_0 \sin \left(\theta _0\right) \cos \left(\phi _0\right),r \sin (\theta ) \sin (\phi )+r_0 \sin \left(\theta _0\right) \sin \left(\phi _0\right)\right) $$

In this last line, there is a two-argument variant of arctan, which is explained here, for example.

$\endgroup$
1
  • $\begingroup$ Thanks a million, This will make my life so much easier. $\endgroup$ – Ned Bingham Jan 9 '10 at 7:45

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.