# Changing Coordinate Systems

Changing coordinate systems can involve two very different operations. One is recomputing coordinate values that correspond to the same point. The other is re-expressing a field in terms of new variables. *Mathematica* provides functions to perform both these operations.

## Converting Points

Two coordinate systems are related by a mapping that takes coordinate values in the old system and returns coordinate values in the new system.

CoordinateTransformData[transf,"Mapping"] | the mapping between coordinate systems as a pure function |

CoordinateTransformData[transf,"Mapping",pt] | the new coordinate values of pt |

CoordinateTransform[transf,pt] | the new coordinate values of pt |

Converting points between two coordinate systems.

The function CoordinateTransformData returns information about mappings between the coordinate systems in CoordinateChartData.

In[6]:= |

Out[6]= |

In[7]:= |

Out[7]= |

In[8]:= |

Out[8]= |

In[9]:= |

Out[9]= |

In[10]:= |

Out[10]= |

The function CoordinateTransform provides a convenient mechanism for converting one or several points.

In[11]:= |

Out[11]= |

In[12]:= |

Out[12]= |

In[13]:= |

Out[13]= |

In[14]:= |

Out[14]= |

## Transforming Fields

When transforming fields between two coordinate systems, a field given in terms of variables in the old system is re-expressed in terms of variables in the new system. In addition to the mapping between the systems, several additional steps are needed: solving for the old variables in terms of the new, substituting in these expressions, and, in the case of vector and tensor fields, accounting for differences in basis vectors between the two coordinate systems. All of these steps are performed by the command TransformedField.

TransformedField[transf,f,{x_{1},x_{2},...,x_{n}}->{y_{1},y_{2},...,y_{n}}] | transform a scalar, vector, or tensor field f from coordinates to coordinates |

Transforming a field between two coordinate systems.

The simpler scalar case is considered first.

In[15]:= |

Out[15]= |

In[16]:= |

Out[16]= |

In[17]:= |

Out[17]= |

In[18]:= |

Out[18]= |

In[19]:= |

Out[19]= |

The vector and tensor case is more complicated because of the need to account for the change of basis vectors. As a result, the transformation of a vector is not merely the transformation of its components. For arrays, which are interpreted as components in an orthonormal basis, the rotation matrix that relates the two bases is given by the CoordinateTransformData property .

In[20]:= |

Out[20]= |

In[21]:= |

Out[21]= |

In[22]:= |

Out[22]= |

In[23]:= |

Out[23]= |

In[24]:= |

Out[24]= |

In[25]:= |

Out[25]= |

In[26]:= |

Out[26]= |

In[27]:= |

Out[27]= |

In[28]:= |

Out[28]= |

In[29]:= |

Out[29]= |

In[30]:= |

Out[30]= |

In[31]:= |

Out[31]= |

In[32]:= |

Out[32]= |

In[33]:= |

Out[33]= |

## Relating Orthonormal Bases

The basis rotation matrix used above combines information about both the Jacobian matrix of the mapping and the orthonormal basis in each chart. For orthogonal coordinate systems, it is constructed from the Jacobian and the two sets of scale factors.

CoordinateTransformData[transf,prop,pt] | compute a property of the transformation at the point pt |

CoordinateChartData[chart,prop,pt] | compute a property of the chart at the point pt |

Computing properties of charts and transformations.

In[34]:= |

Out[34]= |

In[35]:= |

Out[35]= |

In[36]:= |

Out[36]= |

In[37]:= |

Out[37]= |

In[38]:= |

Out[38]= |

In[39]:= |

Out[39]= |

In[40]:= |

Out[40]= |

In[43]:= |

Out[43]= |

In[44]:= |

Out[44]= |

In[45]:= |

Out[45]= |

In[46]:= |

Out[46]= |

In[47]:= |

Out[47]= |

In[48]:= |

Out[48]= |

In[49]:= |

Out[49]= |