List of canonical coordinate transformations
From Wikipedia, the free encyclopedia
This is a list of canonical coordinate transformations.
Contents |
[edit] 2-Dimensional
Let (x, y) be the standard Cartesian coordinates, and r and θ the standard polar coordinates.
[edit] To Cartesian coordinates from polar coordinates
- <math>x=r\,\cos\theta \quad</math>
- <math>y=r\,\sin\theta \quad</math>
[edit] To polar coordinates from Cartesian coordinates
- <math>r=\sqrt{x^2 + y^2}</math>
- <math>\theta = \arctan\frac{y}{x}</math>
Note: the result is an angle over 2π or 360° (0° to 360°, −180° to +180°, etc.) As the main value of the arctangent is defined only to be from −90° to +90°, one should add or subtract 180° when x<0. In addition when x=0 the division is undefined; yet the angle exists and is ±90° depending on the sign of y. Alternatively one could take the arccotangent of x/y in this case. Another special case to be aware of is the case when both x and y are zero.
Anyhow these special exceptions, although easily allowed for when calculated by hand, make the writing of a general computer program quite a task. Luckily most computer languages provide in addition to the normal arctangent, also an arctangent with 2 arguments with exactly the wanted behaviour. On electronic pocket calculators that function is usually called R->P (rectangular to polar).
[edit] 3-Dimensional
Let (x, y, z) be the standard Cartesian coordinates, and (r, θ, φ) the spherical coordinates, with φ the angle measured away from the +Z axis. As θ has a range of 360° the same considerations as in polar (2 dimensional) coordinates apply whenever an arctangent of it is taken. φ has a range of 180°, running from 0° to 180°, and does not pose any problem when calculated from an arccosine, but beware for an arctangent. If, in the alternative definition, φ is chosen to run from −90° to +90°, in opposite direction of the earlier definition, it can be found uniquely from an arcsine, but beware of an arccotangent. In this case in all formulas below all arguments in φ should have sine and cosine exchanged, and as derivative also a plus and minus exchanged.
All divisions by zero result in special cases of being directions along one of the mainaxes and are in practice most easily solved by observation.
[edit] To Cartesian coordinates
[edit] From spherical coordinates
- <math>{x}=\rho \, \sin\phi \, \cos\theta \quad </math>
- <math>{y}=\rho \, \sin\phi \, \sin\theta \quad </math>
- <math>{z}=\rho \, \cos\phi \quad </math>
- <math>
\frac{\partial(x, y, z)}{\partial(\rho, \theta, \phi)} = \begin{pmatrix} \sin\phi\cos\theta & -\rho\sin\phi\sin\theta & \rho\cos\phi\cos\theta \\ \sin\phi\sin\theta & \rho\sin\phi\cos\theta & \rho\cos\phi\sin\theta \\ \cos\phi & 0 & -\rho\sin\phi \end{pmatrix} </math>
- <math>
\det{\frac{\partial(x, y, z)}{\partial(\rho, \theta, \phi)}} = \rho^2 \sin\phi \; d\rho \; d\theta \; d\phi \; </math>
[edit] From cylindrical coordinates
- <math>{x}={r} \,\cos\theta</math>
- <math>{y}={r} \, \sin\theta</math>
- <math>{z}={h} \,</math>
- <math>
\frac{\partial(x, y, z)}{\partial(r, \theta, h)} = \begin{pmatrix} \cos\theta & -r\sin\theta & 0 \\ \sin\theta & r\cos\theta & 0 \\
0 & 0 & 1
\end{pmatrix} </math>
- <math>
\det{\frac{\partial(x, y, z)}{\partial(r, \theta, h)}} = {r}\; dr \; d\theta \; dh \;
</math>
[edit] To Spherical coordinates
[edit] From Cartesian coordinates
- <math>{\rho} = \sqrt{x^2+y^2+z^2}</math>
- <math>{\theta} = \arccos \frac{x}{\sqrt{x^2+y^2}} = \arcsin \frac{y}{\sqrt{x^2+y^2}} = \arctan\frac{y}{x}</math>
- <math>{\phi} = \arccos\frac{z}{\sqrt{x^2+y^2+z^2}} = \arctan\frac{\sqrt{x^2+y^2}}{z}</math>
- <math>
\frac{\partial(\rho, \theta, \phi)}{\partial(x, y, z)} = \begin{pmatrix}
\frac{x}{\rho} & \frac{y}{\rho} & \frac{z}{\rho} \\
\frac{-y}{x^2+y^2} & \frac{x}{x^2+y^2} & 0 \\
\frac{xz}{\rho^2\sqrt{x^2+y^2}} & \frac{yz}{\rho^2\sqrt{x^2+y^2}} & \frac{-(x^2+y^2)}{\rho^2\sqrt{x^2+y^2}} \end{pmatrix} </math>
[edit] From cylindrical coordinates
- <math>{\rho}=\sqrt{r^2+h^2}</math>
- <math>{\theta}=\theta \quad</math>
- <math>{\phi}=\arctan\frac{r}{h}</math>
- <math>
\frac{\partial(\rho, \theta, \phi)}{\partial(r, \theta, h)} = \begin{pmatrix} \frac{r}{\sqrt{r^2+h^2}} & 0 & \frac{h}{\sqrt{r^2+h^2}} \\ 0 & 1 & 0 \\ \frac{-h}{r^2+h^2} & 0 & \frac{r}{r^2+h^2} \end{pmatrix} </math>
- <math> \det \frac{\partial(\rho, \theta, \phi)}{\partial(r, \theta, h)} = \frac{1}{\sqrt{r^2+h^2}}</math>
[edit] To cylindrical coordinates
[edit] From Cartesian coordinates
- <math>r=\sqrt{x^2 + y^2}</math>
- <math>\theta=\arctan\frac{y}{x} + \pi u_0(-x) \, \operatorname{sgn} y </math>
- <math>h=z \quad</math>
- <math>
\frac{\partial(r, \theta, h)}{\partial(x, y, z)} = \begin{pmatrix} \frac{x}{\sqrt{x^2+y^2}}&\frac{y}{\sqrt{x^2+y^2}}&0\\ \frac{-y}{x^2+y^2}&\frac{x}{x^2+y^2}&0\\ 0&0&1 \end{pmatrix} </math>
[edit] From spherical coordinates
- <math> r = \rho \sin \phi \,</math>
- <math> \theta = \theta \,</math>
- <math> h = \rho \cos \phi \,</math>
- <math>
\frac{\partial(r, \theta, h)}{\partial(\rho, \theta, \phi)} = \begin{pmatrix} \sin\phi & 0 & \rho\cos\phi \\ 0 & 1 & 0 \\ \cos\phi & 0 & -\rho\sin\phi \end{pmatrix} </math>
- <math> \det\frac{\partial(r, \theta, h)}{\partial(\rho, \theta, \phi)} = - \rho </math>

