Function Repository Resource:

# CoordinateMappingData

Calculate characteristic properties for a generalized mapping between two coordinate systems

Contributed by: Lars Ulke-Winter
 ResourceFunction["CoordinateMappingData"][mapping,property] gives the value of the specified property for the coordinate transformation mapping. ResourceFunction["CoordinateMappingData"][mapping,property,{x1,x2,…,xn}] gives the value of the property evaluated at the point {x1,x2,…,xn}.

## Details and Options

Metrics and Jacobians are fundamental objects in differential geometry and tensor analysis. ResourceFunction["CoordinateMappingData"] generalizes CoordinateChartData and CoordinateTransformData for arbitrary mappings between systems.
The value for mapping should be a Function or List of relations between coordinates.
Available properties include:
 "CovariantBaseVectors" covariant base vectors bi (tangential to the coordinates lines) "ContravariantBaseVectors" contravariant base vectors bj "Metric" components of the 2-rank covariant metric tensor bij=bi·bj "InverseMetric" components of the 2-rank contravariant metric tensor bkl=bk·bl, with "VolumeFactor" coefficient of the differential in volume (surface, line) integrals, "LeviCivitaCovariant" , where ei…n is "LeviCivitaContravariant" "MappingJacobian" Jacobian matrix of the mapping "MappingJacobianDeterminant" determinant of the mapping Jacobian matrix "InverseMappingJacobian" inverse of the Jacobian matrix of the mapping
Contravariant base vectors bj are also known as dual base vectors because the satisfy the relation .
For mappings to a lower-dimensional manifold, the "MappingJacobian" property returns the mixed shift tensor.
ResourceFunction["CoordinateMappingData"] takes the following option:
 "UnitVectors" False whether the components of the basis should be normalized

## Examples

### Basic Examples (5)

Define local covariant base vectors in cylindrical coordinates:

 In[1]:=
 Out[1]=

Get covariant base vectors at point {r,ϕ,z}:

 In[2]:=
 Out[2]=

Define a mapping and coordinate system:

 In[3]:=

Calculate the associated covariant and contravariant base vectors:

 In[4]:=
 Out[4]=
 In[5]:=
 Out[5]=

Get normalized covariant and contravariant base vectors:

 In[6]:=
 In[7]:=
 Out[7]=
 In[8]:=
 Out[8]=

Verify their inverse relationships:

 In[9]:=
 Out[9]=

Get the covariant metric of mapping to a cylindrical system:

 In[10]:=
 In[11]:=
 Out[11]=

Compare the result with the cataloged named system of CoordinateChartData:

 In[12]:=
 Out[12]=

Do a similar computation to get the inverse metric:

 In[13]:=
 Out[13]=
 In[14]:=
 Out[14]=

Verify their inverse relationship:

 In[15]:=
 Out[15]=

Identify the volume factor of a mapping:

 In[16]:=
 In[17]:=
 Out[17]=

Compare with CoordinateChartData:

 In[18]:=
 Out[18]=

Calculate the covariant components of the Levi-Civita tensor :

 In[19]:=
 Out[19]=

Get the contravariant components of the Levi-Civita tensor :

 In[20]:=
 Out[20]=

Find out which properties are available:

 In[21]:=
 Out[21]=

### Scope (9)

Use the contravariant Levi-Civita symbol to evaluate the cross product :

 In[22]:=
 In[23]:=
 Out[19]=

Check the above result by calculating the cross product of contravariant base vectors b3=b1b2:

 In[24]:=
 Out[15]=

#### Affine coordinate transformation (1)

Find out the properties of an affine coordinate transformation:

 In[25]:=
 In[26]:=
 Out[18]=

#### Polar coordinate transformation (1)

Compute properties for polar coordinates:

 In[27]:=
 Out[26]=

#### Surfaces embedded in 3D Euclidean space (4)

Identify some metrics on the surface of a sphere:

 In[28]:=

Get the tangent space (represented by the covariant vectors):

 In[29]:=
 In[30]:=
 Out[30]=
 In[31]:=
 Out[31]=

Find out the corresponding area factor:

 In[32]:=
 Out[32]=

Calculate the 2x2 metric tensor:

 In[33]:=
 Out[33]=

Note that these components of the covariant metric tensor correspond to the coefficients of the so-called first fundamental form. Confirm this using the resource function FirstFundamentalFormCoefficients:

 In[34]:=
 Out[34]=

Generate some metrics of a torus surface:

 In[35]:=

Get the covariant vectors (corresponding to the tangent space):

 In[36]:=
 In[37]:=
 Out[37]=
 In[38]:=
 Out[38]=

Test the orthogonality of the tangent space:

 In[39]:=
 Out[39]=

Compute the unit normal using the resource function UnitNormal and compare with the associated cross product:

 In[40]:=
 Out[40]=

Determine the covariant metric tensor:

 In[41]:=
 Out[41]=

Define a heart surface and determine some properties:

 In[42]:=
 In[43]:=
 In[44]:=
 Out[44]=
 In[45]:=
 Out[45]=

Compute the Jacobian and covariant metric tensor of a surface of revolution of a general curve r(z):

 In[46]:=
 Out[46]=
 In[47]:=
 Out[47]=

#### Curve embedded in 2D Euclidean space (3)

Obtain the arc length of a general 2D curve:

 In[48]:=
 Out[48]=
 In[49]:=
 Out[49]=

Compute the covariant vectors for a circle:

 In[50]:=
 Out[50]=

Visualize them using the resource function PlotVector:

 In[51]:=
 Out[51]=

Compute the circle's circumference:

 In[52]:=
 Out[52]=

Plot a Cornu spiral and compute its length:

 In[53]:=
 Out[53]=
 In[54]:=
 Out[54]=
 In[55]:=
 Out[55]=

### Options (4)

The option "UnitVectors" controls whether returned basis vectors are normalized. The default value is False:

 In[56]:=
 Out[56]=
 In[57]:=
 Out[57]=

Use "UnitVectors"True to get normalized basis vectors:

 In[58]:=
 Out[58]=
 In[59]:=
 Out[59]=

Compute the surface area and volume of a generic torus through integration:

 In[60]:=
 In[61]:=
 Out[61]=
 In[62]:=
 Out[62]=

Compare, using named properties in cataloged surfaces here:

 In[63]:=
 Out[63]=
 In[64]:=
 Out[64]=

Compute the geodesic of a toroid:

 In[65]:=
 Out[65]=

Plot the geodesic curve:

 In[66]:=
 In[67]:=
 Out[67]=

Calculate the curve's length:

 In[68]:=
 Out[68]=

Define the normal vectors of a surface of revolution:

 In[69]:=

The inverse shift tensor connects the surface space with the Euclidean ambient space:

 In[70]:=

The normal space :

 In[71]:=
 Out[71]=

Plot normals of a random surface of revolution using the resource function PlotVector3D:

 In[72]:=
 Out[73]=
 In[74]:=
 In[75]:=
 In[76]:=
 Out[76]=

### Properties and Relations (3)

The Jacobian matrix can be calculated with several Wolfram Language functions:

 In[77]:=
 In[78]:=
 Out[78]=

"MappingJacobian" and the transposition of "CovariantBaseVectors" represent the same property:

 In[79]:=
 Out[79]=
 In[80]:=
 Out[80]=

"InverseMappingJacobian" and "ContravariantBaseVectors" represent the same property as long as the mapping is between spaces of the same dimensionality:

 In[81]:=
 Out[81]=
 In[82]:=
 Out[82]=

### Possible Issues (2)

For mappings to a manifold embedded in higher dimensional space, the properties "MappingJacobianDeterminant" and "InverseMappingJacobian" are not well-defined:

 In[83]:=
 Out[83]=
 In[84]:=
 Out[84]=
 In[85]:=
 Out[85]=

But "ContravariantBaseVectors" exists (so that, in this case, it is not the same as "InverseMappingJacobian"):

 In[86]:=
 Out[86]=

Lars Ulke-Winter

## Version History

• 1.0.0 – 22 March 2022

## Author Notes

#### Some remarks about the mapping in different spaces

The shift tensor or Jacobian matrix of the mapping (mixed tensor who connects the euclidean ambient space and surface space) can also be computed from the dyadic product of the contravariant base vectors of the ambient space and the covariant base vectors of the surface space (tangent space):

 In[1]:=
 In[2]:=
 In[3]:=
 In[4]:=

Because of the different dimensions of the spaces (ambient space is 3D, the surface is 2D), their exists no inverse matrix of (no "InverseMappingJacobian"). However, the inverse shift tensor can been generated by the reverse definition :

 In[5]:=
 In[6]:=

Confirm that the inverse relationship holds:

 In[7]:=

Note that there is a connection between various shift tensors. For example: A curve (parameterized by UΦ) that is embedded in a surface (with surface parameters Sα=Sα(UΦ)) which in itself is embedded in Euclidean space (with coordinates Xi). The Euclidean coordinates of the curve can thus be represented as a nested function Xi(UΦ)=Xi(Sα(UΦ)), and vice versa, the curve parameter can be represented as a function of the Euclidean coordinates UΦ(Xi)=UΦ(Sα(Xi)).

Thus, the following dependencies can be determined for the individual shift tensors by differentiation (via the chain rule) of these relationships according to the curve parameter or Euclidean coordinates:

With the shift tensors,:

Euclidean coordinates⟷curve parameters:
Euclidean coordinates⟷surface parameters:
surface parameters⟷curve parameters:
 In[8]:=

Generate the various shift tensors :

 In[9]:=

Confirm :

 In[10]:=

Get the inverse shift tensor through index juggling and the resource function EinsteinSummation:

 In[11]:=

Compare the connection according to the definition :

 In[12]:=
 In[13]:=