Wolfram Language

Algebra and Number Theory

Polar and Spherical Coordinates

New, dedicated functions are available to convert between Cartesian and the two most important non-Cartesian coordinate systems: polar coordinates and spherical coordinates.

Convert between Cartesian and polar coordinates.

In[1]:=
Click for copyable input
ToPolarCoordinates[{x, y}]
Out[1]=
In[2]:=
Click for copyable input
FromPolarCoordinates[{r, \[Theta]}]
Out[2]=

Convert between Cartesian and spherical coordinates.

In[3]:=
Click for copyable input
ToSphericalCoordinates[{x, y, z}]
Out[3]=
In[4]:=
Click for copyable input
FromSphericalCoordinates[{r, \[Theta], \[CurlyPhi]}]
Out[4]=

Polar coordinates naturally generalize to higher dimensions.

In[5]:=
Click for copyable input
ToPolarCoordinates[{w, x, y, z}]
Out[5]=
In[6]:=
Click for copyable input
FromPolarCoordinates[{r, \[Theta]1, \[Theta]2, \[Theta]3, \ \[CurlyPhi]}]
Out[6]=

Plot curves expressed in polar and spherical coordinates.

In[7]:=
Click for copyable input
ParametricPlot[ FromPolarCoordinates[{Exp[-t/10], t}] // Evaluate, {t, 0, 50}, PlotRange -> All]
Out[7]=
In[8]:=
Click for copyable input
ParametricPlot3D[ FromSphericalCoordinates[{1, TriangleWave[{0, Pi}, p/(2 Pi)], p}] // Evaluate, {p, 0, 2 Pi}]
Out[8]=

Related Examples

de es fr ja ko pt-br ru zh