Recentering a Spherical Coordinate Sytem - MathOverflow most recent 30 from http://mathoverflow.net 2013-05-23T20:51:11Z http://mathoverflow.net/feeds/question/11208 http://www.creativecommons.org/licenses/by-nc/2.5/rdf http://mathoverflow.net/questions/11208/recentering-a-spherical-coordinate-sytem Recentering a Spherical Coordinate Sytem Ned 2010-01-09T03:12:49Z 2010-01-09T04:09:28Z <p>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 )$?</p> <p>In cartesian coordinates, you would simply subtract the two vectors.</p> http://mathoverflow.net/questions/11208/recentering-a-spherical-coordinate-sytem/11214#11214 Answer by Mariano Suárez-Alvarez for Recentering a Spherical Coordinate Sytem Mariano Suárez-Alvarez 2010-01-09T03:46:05Z 2010-01-09T04:09:28Z <p>This is going to be unsightly...</p> <p>The following Mathematica code:</p> <pre> Needs["VectorAnalysis`"] Simplify@ CoordinatesFromCartesian[ CoordinatesToCartesian[{r, theta, phi}, Spherical] + CoordinatesToCartesian[{r0, theta0, phi0}, Spherical], Spherical ] </pre> <p>gives the following output (doctored so that it looks nicer):</p> <p><code>$$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}$$</code></p> <p><code>$$\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)$$</code></p> <p><code>$$\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)$$</code></p> <p>In this last line, there is a two-argument variant of arctan, which is explained <a href="http://en.wikipedia.org/wiki/Inverse%5Ftrigonometric%5Ffunctions#Two-argument%5Fvariant%5Fof%5Farctangent" rel="nofollow">here</a>, for example.</p>