ChangeCoordinates - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Home : Support : Online Help : Physics : Vectors : ChangeCoordinates

Physics[Vectors][ChangeCoordinates] - change the coordinates in an expression to one of Cartesian, cylindrical and spherical coordinates

 Calling Sequence ChangeCoordinates(A, coordinates) ChangeCoordinates(A, coordinates, alsothebasis)

Parameters

 A - any valid Maple expression coordinates - one of the coordinates identifiers {1, 2, 3}, or one of the related keywords cartesian, cylindrical, or spherical alsothebasis - optional, to indicate that the unit vectors present in A should also be expressed in terms of the unit vectors associated to coordinates

Description

 • ChangeCoordinates changes the coordinates of a given expression, possible a vector function, to the indicated system of coordinates. Optionally, when the argument alsothebasis is given, the unit vectors present in A are also rewritten in terms of the unit vectors associated to the system of coordinates indicated. ChangeCoordinates is thus complementary to ChangeBasis. For the conventions used in the Physics[Vectors] subpackage to represent vector functions, see conventions.
 • The coordinates are changed according to the following. From cartesian $\left[x,y,z\right]$ to cylindrical $\left[\mathrm{\rho },\mathrm{\phi },z\right]$:

$x=\mathrm{\rho }\mathrm{cos}\left(\mathrm{\phi }\right)$

$y=\mathrm{\rho }\mathrm{sin}\left(\mathrm{\phi }\right)$

 From cartesian $\left[x,y,z\right]$ to spherical $\left[r,\mathrm{\theta },\mathrm{\phi }\right]$ (note the ordering of the angles):

$x=r\mathrm{sin}\left(\mathrm{\theta }\right)\mathrm{cos}\left(\mathrm{\phi }\right)$

$y=r\mathrm{sin}\left(\mathrm{\theta }\right)\mathrm{sin}\left(\mathrm{\phi }\right)$

$z=r\mathrm{cos}\left(\mathrm{\theta }\right)$

 • For the formulas used to change the unit vectors when alsothebasis is passed, see ChangeBasis.
 • The %ChangeCoordinates is the inert form of ChangeCoordinates, that is: it represents the same mathematical operation while holding the operation unperformed. To activate the operation use value.

Examples

 > $\mathrm{with}\left(\mathrm{Physics}\left[\mathrm{Vectors}\right]\right)$
 $\left[{\mathrm{&x}}{,}{\mathrm{+}}{,}{\mathrm{.}}{,}{\mathrm{Assume}}{,}{\mathrm{ChangeBasis}}{,}{\mathrm{ChangeCoordinates}}{,}{\mathrm{CompactDisplay}}{,}{\mathrm{Component}}{,}{\mathrm{Curl}}{,}{\mathrm{DirectionalDiff}}{,}{\mathrm{Divergence}}{,}{\mathrm{Gradient}}{,}{\mathrm{Identify}}{,}{\mathrm{Laplacian}}{,}{\nabla }{,}{\mathrm{Norm}}{,}{\mathrm{ParametrizeCurve}}{,}{\mathrm{ParametrizeSurface}}{,}{\mathrm{ParametrizeVolume}}{,}{\mathrm{Setup}}{,}{\mathrm{Simplify}}{,}{\mathrm{^}}{,}{\mathrm{diff}}{,}{\mathrm{int}}\right]$ (1)
 > $\mathrm{Setup}\left(\mathrm{mathematicalnotation}=\mathrm{true}\right)$
 $\left[{\mathrm{mathematicalnotation}}{=}{\mathrm{true}}\right]$ (2)

A cartesian projected vector

 > $R≔x\mathrm{_i}+y\mathrm{_j}+z\mathrm{_k}$
 ${R}{≔}{x}{}\stackrel{{\wedge }}{{i}}{+}{y}{}\stackrel{{\wedge }}{{j}}{+}{z}{}\stackrel{{\wedge }}{{k}}$ (3)

Vector R projected onto the cartesian basis. Rewrite $\left[x,y,z\right]$ entering $R$ in terms of cylindrical and spherical coordinates

 > $\mathrm{ChangeCoordinates}\left(R,2\right)$
 $\stackrel{{\wedge }}{{i}}{}{\mathrm{\rho }}{}{\mathrm{cos}}{}\left({\mathrm{\phi }}\right){+}\stackrel{{\wedge }}{{j}}{}{\mathrm{\rho }}{}{\mathrm{sin}}{}\left({\mathrm{\phi }}\right){+}{z}{}\stackrel{{\wedge }}{{k}}$ (4)
 > $\mathrm{ChangeCoordinates}\left(R,\mathrm{spherical}\right)$
 ${r}{}{\mathrm{sin}}{}\left({\mathrm{\theta }}\right){}{\mathrm{cos}}{}\left({\mathrm{\phi }}\right){}\stackrel{{\wedge }}{{i}}{+}{r}{}{\mathrm{sin}}{}\left({\mathrm{\theta }}\right){}{\mathrm{sin}}{}\left({\mathrm{\phi }}\right){}\stackrel{{\wedge }}{{j}}{+}{r}{}\stackrel{{\wedge }}{{k}}{}{\mathrm{cos}}{}\left({\mathrm{\theta }}\right)$ (5)

Change also the basis of unit vectors

 > $\mathrm{ChangeCoordinates}\left(R,\mathrm{cylindrical},\mathrm{alsothebasis}\right)$
 ${z}{}\stackrel{{\wedge }}{{k}}{+}{\mathrm{\rho }}{}\stackrel{{\wedge }}{{\mathrm{\rho }}}$ (6)
 > $\mathrm{ChangeCoordinates}\left(R,3,\mathrm{alsothebasis}\right)$
 ${r}{}\stackrel{{\wedge }}{{r}}$ (7)