Function Repository Resource:

CoordinateMappingData

Source Notebook

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 ein is LeviCivitaTensor[n]
"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"Falsewhether the components of the basis should be normalized

Examples

Basic Examples (5) 

Define local covariant base vectors in cylindrical coordinates:

In[1]:=
ResourceFunction[
 "CoordinateMappingData"][{Cos[#1[[2]]] #1[[1]], Sin[#1[[2]]] #1[[1]], #1[[3]]} &, "CovariantBaseVectors"]
Out[1]=

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

In[2]:=
ResourceFunction[
  "CoordinateMappingData"][{Cos[#1[[2]]] #1[[1]], Sin[#1[[2]]] #1[[1]], #1[[3]]} &, "CovariantBaseVectors"][{r, \[Phi], z}]
Out[2]=

Define a mapping and coordinate system:

In[3]:=
mapping = {r Cos[\[Phi]], r Sin[\[Phi]], z}; coords = {r, \[Phi], z};

Calculate the associated covariant and contravariant base vectors:

In[4]:=
covBasis = ResourceFunction["CoordinateMappingData"][mapping, "CovariantBaseVectors", coords]
Out[4]=
In[5]:=
conBasis = ResourceFunction["CoordinateMappingData"][mapping, "ContravariantBaseVectors", coords] // Simplify
Out[5]=

Get normalized covariant and contravariant base vectors:

In[6]:=
mapping = {r Cos[\[Phi]], r Sin[\[Phi]], z}; coords = {r, \[Phi], z};
In[7]:=
covBasisNormalized = ResourceFunction["CoordinateMappingData"][mapping, "CovariantBaseVectors", coords, "UnitVectors" -> True] // Simplify[#, {r > 0, \[Phi] > 0}] &
Out[7]=
In[8]:=
conBasisNormalized = ResourceFunction["CoordinateMappingData"][mapping, "ContravariantBaseVectors", coords, "UnitVectors" -> True] // Simplify[#, {r > 0, \[Phi] > 0}] &
Out[8]=

Verify their inverse relationships:

In[9]:=
Table[covBasisNormalized[[i]] . conBasisNormalized[[j]], {i, 3}, {j, 3}] // Simplify // MatrixForm
Out[9]=

Get the covariant metric of mapping to a cylindrical system:

In[10]:=
mapping = {r Cos[\[Phi]], r Sin[\[Phi]], z}; coords = {r, \[Phi], z};
In[11]:=
(covMetric = ResourceFunction["CoordinateMappingData"][mapping, "Metric", coords] // Simplify) // MatrixForm
Out[11]=

Compare the result with the cataloged named system of CoordinateChartData:

In[12]:=
CoordinateChartData["Cylindrical", "Metric", coords] // MatrixForm
Out[12]=

Do a similar computation to get the inverse metric:

In[13]:=
(conMetric = ResourceFunction["CoordinateMappingData"][mapping, "InverseMetric",
      coords] // Simplify) // MatrixForm
Out[13]=
In[14]:=
CoordinateChartData["Cylindrical", "InverseMetric", coords] // MatrixForm
Out[14]=

Verify their inverse relationship:

In[15]:=
covMetric . conMetric // MatrixForm
Out[15]=

Identify the volume factor of a mapping:

In[16]:=
mapping = {r Cos[\[Phi]], r Sin[\[Phi]], z}; coords = {r, \[Phi], z};
In[17]:=
ResourceFunction["CoordinateMappingData"][mapping, "VolumeFactor", coords] // Simplify[#, r > 0] &
Out[17]=

Compare with CoordinateChartData:

In[18]:=
CoordinateChartData["Cylindrical", "VolumeFactor", coords]
Out[18]=

Calculate the covariant components of the Levi-Civita tensor :

In[19]:=
ResourceFunction["CoordinateMappingData"][mapping, "LeviCivitaCovariant", coords] // Simplify[#, r > 0] &
Out[19]=

Get the contravariant components of the Levi-Civita tensor :

In[20]:=
ResourceFunction["CoordinateMappingData"][mapping, "LeviCivitaContravariant", coords] // Simplify[#, r > 0] &
Out[20]=

Find out which properties are available:

In[21]:=
ResourceFunction["CoordinateMappingData"]["Properties"]
Out[21]=

Scope (9) 

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

In[22]:=
mapping = {r Cos[\[Phi]], r Sin[\[Phi]], z}; coords = {r, \[Phi], z};
In[23]:=
wCon = ResourceFunction["CoordinateMappingData"][mapping, "LeviCivitaContravariant", coords] . {0, 1, 0} . {1, 0, 0} // Simplify[#, r > 0] &;
covBasis = ResourceFunction["CoordinateMappingData"][mapping, "CovariantBaseVectors", coords];
\!\(
\*UnderoverscriptBox[\(\[Sum]\), \(i = 1\), \(3\)]\(wCon[[
   i]] covBasis[[i]]\)\)
Out[19]=

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

In[24]:=
conBasis = ResourceFunction["CoordinateMappingData"][mapping, "ContravariantBaseVectors", coords] // Simplify;
(conBasis[[1]]\[Cross]conBasis[[2]]) // Simplify
Out[15]=

Affine coordinate transformation (1) 

Find out the properties of an affine coordinate transformation:

In[25]:=
mapping = {3 x + y, 2 z, y + z}; coords = {x, y, z};
In[26]:=
{conBasis, covBasis, invJacobian, conMetric, conLeviCivita, covLeviCivita, jacobian, jacobianDet, covMetric, volumefactor} = ResourceFunction["CoordinateMappingData"][mapping, #, coords] & /@ (ResourceFunction["CoordinateMappingData"][
     "Properties"]);
MatrixForm /@ %
Out[18]=

Polar coordinate transformation (1) 

Compute properties for polar coordinates:

In[27]:=
mapping = {r Cos[\[Phi]], r Sin[\[Phi]]}; coords = {r, \[Phi]};
ResourceFunction["CoordinateMappingData"][mapping, #, coords] & /@ ResourceFunction["CoordinateMappingData"]["Properties"] // Simplify[#, r > 0] &
Out[26]=

Surfaces embedded in 3D Euclidean space (4) 

Identify some metrics on the surface of a sphere:

In[28]:=
mapping = {r Sin[u] Cos[v], r Sin[u] Sin[v], r Cos[u]}; coords = {u, v};

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

In[29]:=
cov = ResourceFunction["CoordinateMappingData"][mapping, "CovariantBaseVectors", coords];
In[30]:=
cov[[1]] // MatrixForm
Out[30]=
In[31]:=
cov[[2]] // MatrixForm
Out[31]=

Find out the corresponding area factor:

In[32]:=
areaFactor = ResourceFunction["CoordinateMappingData"][mapping, "VolumeFactor", coords] // Simplify[#, r > 0] &
Out[32]=

Calculate the 2x2 metric tensor:

In[33]:=
ResourceFunction["CoordinateMappingData"][mapping, "Metric", coords] //
   Simplify // MatrixForm
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]:=
ResourceFunction["FirstFundamentalFormCoefficients"][mapping, coords] // Simplify
Out[34]=

Generate some metrics of a torus surface:

In[35]:=
mapping = {(R + r Cos[v]) Cos[u], (R + r Cos[v]) Sin[u], r Sin[v]}; coords = {u, v};

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

In[36]:=
cov = ResourceFunction["CoordinateMappingData"][mapping, "CovariantBaseVectors", coords];
In[37]:=
cov[[1]] // MatrixForm
Out[37]=
In[38]:=
cov[[2]] // MatrixForm
Out[38]=

Test the orthogonality of the tangent space:

In[39]:=
cov[[1]] . cov[[2]] == 0
Out[39]=

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

In[40]:=
ResourceFunction["UnitNormal"][mapping, coords] == ComplexExpand@Normalize[cov[[1]]\[Cross]cov[[2]]] // FullSimplify
Out[40]=

Determine the covariant metric tensor:

In[41]:=
ResourceFunction["CoordinateMappingData"][mapping, "Metric", coords] //
   Simplify // MatrixForm
Out[41]=

Define a heart surface and determine some properties:

In[42]:=
heart = {Sin[s2] (15 Sin[s1] - 4 Sin[3 s1]), 8 Cos[s2], Sin[s2] (15 Cos[s1] - 5 Cos[2 s1] - 2 Cos[3 s1] - Cos[2 s1])};
In[43]:=
tangentSpace = ResourceFunction["CoordinateMappingData"][heart, "CovariantBaseVectors", {s1, s2}] // Simplify;
In[44]:=
Show[{
   ParametricPlot3D[heart, {s1, 0, 2 \[Pi]}, {s2, 0, \[Pi]}, PlotStyle -> Red, Mesh -> False],
   ResourceFunction["PlotVector3D"][tangentSpace, heart, VectorStyle -> {{Thick, Blue}}]
   }, Boxed -> False, Axes -> False, PlotRange -> All
  ] /. {s1 -> \[Pi]/5, s2 -> (2 \[Pi])/3}
Out[44]=
In[45]:=
heartSurfaceArea = NIntegrate[
  ResourceFunction["CoordinateMappingData"][heart, "VolumeFactor", {s1, s2}] // Simplify, {s1, 0, 2 \[Pi]}, {s2, 0, \[Pi]}]
Out[45]=

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

In[46]:=
ResourceFunction[
   "CoordinateMappingData"][{r[z] Cos[\[Phi]], r[z] Sin[\[Phi]], z}, "MappingJacobian", {\[Phi], z}] // Simplify // MatrixForm
Out[46]=
In[47]:=
ResourceFunction[
   "CoordinateMappingData"][{r[z] Cos[\[Phi]], r[z] Sin[\[Phi]], z}, "Metric", {\[Phi], z}] // Simplify // MatrixForm
Out[47]=

Curve embedded in 2D Euclidean space (3) 

Obtain the arc length of a general 2D curve:

In[48]:=
\!\(
\*SubsuperscriptBox[\(\[Integral]\), \(0\), \(1\)]\(\*
InterpretationBox[
TagBox[
DynamicModuleBox[{Typeset`open = False}, 
FrameBox[
PaneSelectorBox[{False->GridBox[{
{
PaneBox[GridBox[{
{
StyleBox[
StyleBox[
AdjustmentBox["\<\"[\[FilledSmallSquare]]\"\>",
BoxBaselineShift->-0.25,
BoxMargins->{{0, 0}, {-1, -1}}], "ResourceFunctionIcon",
FontColor->RGBColor[
                  0.8745098039215686, 0.2784313725490196, 0.03137254901960784]],
ShowStringCharacters->False,
FontFamily->"Source Sans Pro Black",
FontSize->0.6538461538461539 Inherited,
FontWeight->"Heavy",
PrivateFontOptions->{"OperatorSubstitution"->False}], 
StyleBox[
RowBox[{
StyleBox["CoordinateMappingData", "ResourceFunctionLabel",
FontFamily->"Source Sans Pro"], " "}],
ShowAutoStyles->False,
ShowStringCharacters->False,
FontSize->Rational[12, 13] Inherited,
FontColor->GrayLevel[0.1]]}
},
GridBoxSpacings->{"Columns" -> {{0.25}}}],
Alignment->Left,
BaseStyle->{LineSpacing -> {0, 0}, LineBreakWithin -> False},
BaselinePosition->Baseline,
FrameMargins->{{3, 0}, {0, 0}}], 
ItemBox[
PaneBox[
TogglerBox[Dynamic[Typeset`open], {True->
DynamicBox[FEPrivate`FrontEndResource["FEBitmaps", "IconizeCloser"],
ImageSizeCache->{11., {1., 10.}}], False->
DynamicBox[FEPrivate`FrontEndResource["FEBitmaps", "IconizeOpener"],
ImageSizeCache->{11., {1., 10.}}]},
Appearance->None,
BaselinePosition->Baseline,
ContentPadding->False,
FrameMargins->0],
Alignment->Left,
BaselinePosition->Baseline,
FrameMargins->{{1, 1}, {0, 0}}],
Frame->{{
RGBColor[
               0.8313725490196079, 0.8470588235294118, 0.8509803921568627, 0.5], False}, {False, False}}]}
},
BaselinePosition->{1, 1},
GridBoxAlignment->{"Columns" -> {{Left}}, "Rows" -> {{Baseline}}},
GridBoxItemSize->{"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}},
         
GridBoxSpacings->{"Columns" -> {{0}}, "Rows" -> {{0}}}], True->GridBox[{
{GridBox[{
{
PaneBox[GridBox[{
{
StyleBox[
StyleBox[
AdjustmentBox["\<\"[\[FilledSmallSquare]]\"\>",
BoxBaselineShift->-0.25,
BoxMargins->{{0, 0}, {-1, -1}}], "ResourceFunctionIcon",
FontColor->RGBColor[
                    0.8745098039215686, 0.2784313725490196, 0.03137254901960784]],
ShowStringCharacters->False,
FontFamily->"Source Sans Pro Black",
FontSize->0.6538461538461539 Inherited,
FontWeight->"Heavy",
PrivateFontOptions->{"OperatorSubstitution"->False}], 
StyleBox[
RowBox[{
StyleBox["CoordinateMappingData", "ResourceFunctionLabel",
FontFamily->"Source Sans Pro"], " "}],
ShowAutoStyles->False,
ShowStringCharacters->False,
FontSize->Rational[12, 13] Inherited,
FontColor->GrayLevel[0.1]]}
},
GridBoxSpacings->{"Columns" -> {{0.25}}}],
Alignment->Left,
BaseStyle->{LineSpacing -> {0, 0}, LineBreakWithin -> False},
BaselinePosition->Baseline,
FrameMargins->{{3, 0}, {0, 0}}], 
ItemBox[
PaneBox[
TogglerBox[Dynamic[Typeset`open], {True->
DynamicBox[FEPrivate`FrontEndResource["FEBitmaps", "IconizeCloser"]], False->
DynamicBox[FEPrivate`FrontEndResource["FEBitmaps", "IconizeOpener"]]},
                 
Appearance->None,
BaselinePosition->Baseline,
ContentPadding->False,
FrameMargins->0],
Alignment->Left,
BaselinePosition->Baseline,
FrameMargins->{{1, 1}, {0, 0}}],
Frame->{{
RGBColor[
                  0.8313725490196079, 0.8470588235294118, 0.8509803921568627, 0.5], False}, {False, False}}]}
},
BaselinePosition->{1, 1},
GridBoxAlignment->{"Columns" -> {{Left}}, "Rows" -> {{Baseline}}},
GridBoxItemSize->{"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}},
            
GridBoxSpacings->{"Columns" -> {{0}}, "Rows" -> {{0}}}]},
{
StyleBox[
PaneBox[GridBox[{
{
RowBox[{
TagBox["\<\"Version (latest): \"\>",
"IconizedLabel"], " ", 
TagBox["\<\"1.0.0\"\>",
"IconizedItem"]}]},
{
TagBox[
TemplateBox[{"\"Documentation »\"", "https://resources.wolframcloud.com/FunctionRepository/resources/81241af7-4081-4251-af9d-2dbfe85051d8/"},
"HyperlinkURL"],
"IconizedItem"]}
},
DefaultBaseStyle->"Column",
GridBoxAlignment->{"Columns" -> {{Left}}},
GridBoxItemSize->{"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}],
Alignment->Left,
BaselinePosition->Baseline,
FrameMargins->{{5, 4}, {0, 4}}], "DialogStyle",
FontFamily->"Roboto",
FontSize->11]}
},
BaselinePosition->{1, 1},
GridBoxAlignment->{"Columns" -> {{Left}}, "Rows" -> {{Baseline}}},
GridBoxDividers->{"Columns" -> {{None}}, "Rows" -> {False, {
GrayLevel[0.8]}, False}},
GridBoxItemSize->{"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}]}, Dynamic[Typeset`open],
BaselinePosition->Baseline,
ImageSize->Automatic],
Background->RGBColor[
        0.9686274509803922, 0.9764705882352941, 0.984313725490196],
BaselinePosition->Baseline,
DefaultBaseStyle->{},
FrameMargins->{{0, 0}, {1, 0}},
FrameStyle->RGBColor[
        0.8313725490196079, 0.8470588235294118, 0.8509803921568627],
RoundingRadius->4]],
{"FunctionResourceBox", 
RGBColor[0.8745098039215686, 0.2784313725490196, 0.03137254901960784],
       "CoordinateMappingData"},
TagBoxNote->"FunctionResourceBox"],
ResourceFunction["CoordinateMappingData"],
BoxID -> "CoordinateMappingData",
Selectable->False][{x1[t], x2[t]}, "\<VolumeFactor\>", {t}] \[DifferentialD]t\)\)
Out[48]=
In[49]:=
% == ArcLength[{x1[t], x2[t]}, {t, 0, 1}]
Out[49]=

Compute the covariant vectors for a circle:

In[50]:=
covBasis = ResourceFunction["CoordinateMappingData"][{r Cos[t], r Sin[t]}, "CovariantBaseVectors", {t}] // Flatten
Out[50]=

Visualize them using the resource function PlotVector:

In[51]:=
Show[ResourceFunction["PlotVector"][
  Table[(covBasis /. {r -> 1, t -> i}), {i, Range[0, 2 \[Pi], \[Pi]/15]}],
  Table[({r Cos[t], r Sin[t]} /. {r -> 1, t -> i}), {i, Range[0, 2 \[Pi], \[Pi]/15]}], VectorStyle -> Red],
 ParametricPlot[{r Cos[t], r Sin[t]} /. r -> 1, {t, 0, 2 \[Pi]}]]
Out[51]=

Compute the circle's circumference:

In[52]:=
\!\(
\*SubsuperscriptBox[\(\[Integral]\), \(0\), \(2  \[Pi]\)]\(\*
InterpretationBox[
TagBox[
DynamicModuleBox[{Typeset`open = False}, 
FrameBox[
PaneSelectorBox[{False->GridBox[{
{
PaneBox[GridBox[{
{
StyleBox[
StyleBox[
AdjustmentBox["\<\"[\[FilledSmallSquare]]\"\>",
BoxBaselineShift->-0.25,
BoxMargins->{{0, 0}, {-1, -1}}], "ResourceFunctionIcon",
FontColor->RGBColor[
                   0.8745098039215686, 0.2784313725490196, 0.03137254901960784]],
ShowStringCharacters->False,
FontFamily->"Source Sans Pro Black",
FontSize->0.6538461538461539 Inherited,
FontWeight->"Heavy",
PrivateFontOptions->{"OperatorSubstitution"->False}], 
StyleBox[
RowBox[{
StyleBox["CoordinateMappingData", "ResourceFunctionLabel",
FontFamily->"Source Sans Pro"], " "}],
ShowAutoStyles->False,
ShowStringCharacters->False,
FontSize->Rational[12, 13] Inherited,
FontColor->GrayLevel[0.1]]}
},
GridBoxSpacings->{"Columns" -> {{0.25}}}],
Alignment->Left,
BaseStyle->{LineSpacing -> {0, 0}, LineBreakWithin -> False},
BaselinePosition->Baseline,
FrameMargins->{{3, 0}, {0, 0}}], 
ItemBox[
PaneBox[
TogglerBox[Dynamic[Typeset`open], {True->
DynamicBox[FEPrivate`FrontEndResource["FEBitmaps", "IconizeCloser"],
ImageSizeCache->{11., {1., 10.}}], False->
DynamicBox[FEPrivate`FrontEndResource["FEBitmaps", "IconizeOpener"],
ImageSizeCache->{11., {1., 10.}}]},
Appearance->None,
BaselinePosition->Baseline,
ContentPadding->False,
FrameMargins->0],
Alignment->Left,
BaselinePosition->Baseline,
FrameMargins->{{1, 1}, {0, 0}}],
Frame->{{
RGBColor[
                0.8313725490196079, 0.8470588235294118, 0.8509803921568627, 0.5], False}, {False, False}}]}
},
BaselinePosition->{1, 1},
GridBoxAlignment->{"Columns" -> {{Left}}, "Rows" -> {{Baseline}}},
GridBoxItemSize->{"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}},
          
GridBoxSpacings->{"Columns" -> {{0}}, "Rows" -> {{0}}}], True->GridBox[{
{GridBox[{
{
PaneBox[GridBox[{
{
StyleBox[
StyleBox[
AdjustmentBox["\<\"[\[FilledSmallSquare]]\"\>",
BoxBaselineShift->-0.25,
BoxMargins->{{0, 0}, {-1, -1}}], "ResourceFunctionIcon",
FontColor->RGBColor[
                    0.8745098039215686, 0.2784313725490196, 0.03137254901960784]],
ShowStringCharacters->False,
FontFamily->"Source Sans Pro Black",
FontSize->0.6538461538461539 Inherited,
FontWeight->"Heavy",
PrivateFontOptions->{"OperatorSubstitution"->False}], 
StyleBox[
RowBox[{
StyleBox["CoordinateMappingData", "ResourceFunctionLabel",
FontFamily->"Source Sans Pro"], " "}],
ShowAutoStyles->False,
ShowStringCharacters->False,
FontSize->Rational[12, 13] Inherited,
FontColor->GrayLevel[0.1]]}
},
GridBoxSpacings->{"Columns" -> {{0.25}}}],
Alignment->Left,
BaseStyle->{LineSpacing -> {0, 0}, LineBreakWithin -> False},
BaselinePosition->Baseline,
FrameMargins->{{3, 0}, {0, 0}}], 
ItemBox[
PaneBox[
TogglerBox[Dynamic[Typeset`open], {True->
DynamicBox[FEPrivate`FrontEndResource["FEBitmaps", "IconizeCloser"]], False->
DynamicBox[FEPrivate`FrontEndResource["FEBitmaps", "IconizeOpener"]]},
                  
Appearance->None,
BaselinePosition->Baseline,
ContentPadding->False,
FrameMargins->0],
Alignment->Left,
BaselinePosition->Baseline,
FrameMargins->{{1, 1}, {0, 0}}],
Frame->{{
RGBColor[
                   0.8313725490196079, 0.8470588235294118, 0.8509803921568627, 0.5], False}, {False, False}}]}
},
BaselinePosition->{1, 1},
GridBoxAlignment->{"Columns" -> {{Left}}, "Rows" -> {{Baseline}}},
GridBoxItemSize->{"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}},
             
GridBoxSpacings->{"Columns" -> {{0}}, "Rows" -> {{0}}}]},
{
StyleBox[
PaneBox[GridBox[{
{
RowBox[{
TagBox["\<\"Version (latest): \"\>",
"IconizedLabel"], " ", 
TagBox["\<\"1.0.0\"\>",
"IconizedItem"]}]},
{
TagBox[
TemplateBox[{"\"Documentation »\"", "https://resources.wolframcloud.com/FunctionRepository/resources/81241af7-4081-4251-af9d-2dbfe85051d8/"},
"HyperlinkURL"],
"IconizedItem"]}
},
DefaultBaseStyle->"Column",
GridBoxAlignment->{"Columns" -> {{Left}}},
GridBoxItemSize->{"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}],
Alignment->Left,
BaselinePosition->Baseline,
FrameMargins->{{5, 4}, {0, 4}}], "DialogStyle",
FontFamily->"Roboto",
FontSize->11]}
},
BaselinePosition->{1, 1},
GridBoxAlignment->{"Columns" -> {{Left}}, "Rows" -> {{Baseline}}},
GridBoxDividers->{"Columns" -> {{None}}, "Rows" -> {False, {
GrayLevel[0.8]}, False}},
GridBoxItemSize->{"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}]}, Dynamic[Typeset`open],
BaselinePosition->Baseline,
ImageSize->Automatic],
Background->RGBColor[
         0.9686274509803922, 0.9764705882352941, 0.984313725490196],
BaselinePosition->Baseline,
DefaultBaseStyle->{},
FrameMargins->{{0, 0}, {1, 0}},
FrameStyle->RGBColor[
         0.8313725490196079, 0.8470588235294118, 0.8509803921568627],
RoundingRadius->4]],
{"FunctionResourceBox", 
RGBColor[0.8745098039215686, 0.2784313725490196, 0.03137254901960784],
        "CoordinateMappingData"},
TagBoxNote->"FunctionResourceBox"],
ResourceFunction["CoordinateMappingData"],
BoxID -> "CoordinateMappingData",
Selectable->False][{r\ Cos[t], r\ Sin[t]}, "\<VolumeFactor\>", {t}] \[DifferentialD]t\)\) // Simplify[#, r > 0] &
Out[52]=

Plot a Cornu spiral and compute its length:

In[53]:=
ParametricPlot[
 Entity["PlaneCurve", "CornuSpiral"]["ParametricEquations"][2][
  t], {t, -4, 4}]
Out[53]=
In[54]:=
\!\(
\*SubsuperscriptBox[\(\[Integral]\), \(-4\), \(4\)]\(\*
InterpretationBox[
TagBox[
DynamicModuleBox[{Typeset`open = False}, 
FrameBox[
PaneSelectorBox[{False->GridBox[{
{
PaneBox[GridBox[{
{
StyleBox[
StyleBox[
AdjustmentBox["\<\"[\[FilledSmallSquare]]\"\>",
BoxBaselineShift->-0.25,
BoxMargins->{{0, 0}, {-1, -1}}], "ResourceFunctionIcon",
FontColor->RGBColor[
                  0.8745098039215686, 0.2784313725490196, 0.03137254901960784]],
ShowStringCharacters->False,
FontFamily->"Source Sans Pro Black",
FontSize->0.6538461538461539 Inherited,
FontWeight->"Heavy",
PrivateFontOptions->{"OperatorSubstitution"->False}], 
StyleBox[
RowBox[{
StyleBox["CoordinateMappingData", "ResourceFunctionLabel",
FontFamily->"Source Sans Pro"], " "}],
ShowAutoStyles->False,
ShowStringCharacters->False,
FontSize->Rational[12, 13] Inherited,
FontColor->GrayLevel[0.1]]}
},
GridBoxSpacings->{"Columns" -> {{0.25}}}],
Alignment->Left,
BaseStyle->{LineSpacing -> {0, 0}, LineBreakWithin -> False},
BaselinePosition->Baseline,
FrameMargins->{{3, 0}, {0, 0}}], 
ItemBox[
PaneBox[
TogglerBox[Dynamic[Typeset`open], {True->
DynamicBox[FEPrivate`FrontEndResource["FEBitmaps", "IconizeCloser"],
ImageSizeCache->{11., {1., 10.}}], False->
DynamicBox[FEPrivate`FrontEndResource["FEBitmaps", "IconizeOpener"],
ImageSizeCache->{11., {1., 10.}}]},
Appearance->None,
BaselinePosition->Baseline,
ContentPadding->False,
FrameMargins->0],
Alignment->Left,
BaselinePosition->Baseline,
FrameMargins->{{1, 1}, {0, 0}}],
Frame->{{
RGBColor[
               0.8313725490196079, 0.8470588235294118, 0.8509803921568627, 0.5], False}, {False, False}}]}
},
BaselinePosition->{1, 1},
GridBoxAlignment->{"Columns" -> {{Left}}, "Rows" -> {{Baseline}}},
GridBoxItemSize->{"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}},
         
GridBoxSpacings->{"Columns" -> {{0}}, "Rows" -> {{0}}}], True->GridBox[{
{GridBox[{
{
PaneBox[GridBox[{
{
StyleBox[
StyleBox[
AdjustmentBox["\<\"[\[FilledSmallSquare]]\"\>",
BoxBaselineShift->-0.25,
BoxMargins->{{0, 0}, {-1, -1}}], "ResourceFunctionIcon",
FontColor->RGBColor[
                    0.8745098039215686, 0.2784313725490196, 0.03137254901960784]],
ShowStringCharacters->False,
FontFamily->"Source Sans Pro Black",
FontSize->0.6538461538461539 Inherited,
FontWeight->"Heavy",
PrivateFontOptions->{"OperatorSubstitution"->False}], 
StyleBox[
RowBox[{
StyleBox["CoordinateMappingData", "ResourceFunctionLabel",
FontFamily->"Source Sans Pro"], " "}],
ShowAutoStyles->False,
ShowStringCharacters->False,
FontSize->Rational[12, 13] Inherited,
FontColor->GrayLevel[0.1]]}
},
GridBoxSpacings->{"Columns" -> {{0.25}}}],
Alignment->Left,
BaseStyle->{LineSpacing -> {0, 0}, LineBreakWithin -> False},
BaselinePosition->Baseline,
FrameMargins->{{3, 0}, {0, 0}}], 
ItemBox[
PaneBox[
TogglerBox[Dynamic[Typeset`open], {True->
DynamicBox[FEPrivate`FrontEndResource["FEBitmaps", "IconizeCloser"]], False->
DynamicBox[FEPrivate`FrontEndResource["FEBitmaps", "IconizeOpener"]]},
                 
Appearance->None,
BaselinePosition->Baseline,
ContentPadding->False,
FrameMargins->0],
Alignment->Left,
BaselinePosition->Baseline,
FrameMargins->{{1, 1}, {0, 0}}],
Frame->{{
RGBColor[
                  0.8313725490196079, 0.8470588235294118, 0.8509803921568627, 0.5], False}, {False, False}}]}
},
BaselinePosition->{1, 1},
GridBoxAlignment->{"Columns" -> {{Left}}, "Rows" -> {{Baseline}}},
GridBoxItemSize->{"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}},
            
GridBoxSpacings->{"Columns" -> {{0}}, "Rows" -> {{0}}}]},
{
StyleBox[
PaneBox[GridBox[{
{
RowBox[{
TagBox["\<\"Version (latest): \"\>",
"IconizedLabel"], " ", 
TagBox["\<\"1.0.0\"\>",
"IconizedItem"]}]},
{
TagBox[
TemplateBox[{"\"Documentation »\"", "https://resources.wolframcloud.com/FunctionRepository/resources/81241af7-4081-4251-af9d-2dbfe85051d8/"},
"HyperlinkURL"],
"IconizedItem"]}
},
DefaultBaseStyle->"Column",
GridBoxAlignment->{"Columns" -> {{Left}}},
GridBoxItemSize->{"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}],
Alignment->Left,
BaselinePosition->Baseline,
FrameMargins->{{5, 4}, {0, 4}}], "DialogStyle",
FontFamily->"Roboto",
FontSize->11]}
},
BaselinePosition->{1, 1},
GridBoxAlignment->{"Columns" -> {{Left}}, "Rows" -> {{Baseline}}},
GridBoxDividers->{"Columns" -> {{None}}, "Rows" -> {False, {
GrayLevel[0.8]}, False}},
GridBoxItemSize->{"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}]}, Dynamic[Typeset`open],
BaselinePosition->Baseline,
ImageSize->Automatic],
Background->RGBColor[
        0.9686274509803922, 0.9764705882352941, 0.984313725490196],
BaselinePosition->Baseline,
DefaultBaseStyle->{},
FrameMargins->{{0, 0}, {1, 0}},
FrameStyle->RGBColor[
        0.8313725490196079, 0.8470588235294118, 0.8509803921568627],
RoundingRadius->4]],
{"FunctionResourceBox", 
RGBColor[0.8745098039215686, 0.2784313725490196, 0.03137254901960784],
       "CoordinateMappingData"},
TagBoxNote->"FunctionResourceBox"],
ResourceFunction["CoordinateMappingData"],
BoxID -> "CoordinateMappingData",
Selectable->False][\(\(\*
TemplateBox[{"\"Cornu spiral\"", 
RowBox[{"Entity", "[", 
RowBox[{"\"PlaneCurve\"", ",", "\"CornuSpiral\""}], "]"}], "\"Entity[\\\"PlaneCurve\\\", \\\"CornuSpiral\\\"]\"", "\"plane curve\""},
"Entity"]["\<ParametricEquations\>"]\)[a]\)[
    t], "\<VolumeFactor\>", {t}] \[DifferentialD]t\)\)
Out[54]=
In[55]:=
ArcLength[
 Entity["PlaneCurve", "CornuSpiral"]["ParametricEquations"][a][
  t], {t, -4, 4}]
Out[55]=

Options (4) 

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

In[56]:=
ResourceFunction[
 "CoordinateMappingData"][{2 x + 2 y, 2 y, 2 z}, "CovariantBaseVectors", {x, y, z}, "UnitVectors" -> False]
Out[56]=
In[57]:=
ResourceFunction[
 "CoordinateMappingData"][{2 x + 2 y, 2 y, 2 z}, "CovariantBaseVectors", {x, y, z}]
Out[57]=

Use "UnitVectors"True to get normalized basis vectors:

In[58]:=
ResourceFunction[
 "CoordinateMappingData"][{2 x + 2 y, 2 y, 2 z}, "CovariantBaseVectors", {x, y, z}, "UnitVectors" -> True]
Out[58]=
In[59]:=
Norm /@ %
Out[59]=

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

In[60]:=
volumefactor = ResourceFunction[
    "CoordinateMappingData"][{(R + r Cos[v]) Cos[
       u], (R + r Cos[v]) Sin[u], r Sin[v]}, "VolumeFactor", {u, v}] //
    Simplify[#, {r > 0, R + r Cos[v] > 0}] &;
In[61]:=
\!\(
\*SubsuperscriptBox[\(\[Integral]\), \(0\), \(2  \[Pi]\)]\(\((
\*SubsuperscriptBox[\(\[Integral]\), \(0\), \(2  \[Pi]\)]volumefactor \[DifferentialD]u)\) \[DifferentialD]v\)\)
Out[61]=
In[62]:=
\!\(
\*SubsuperscriptBox[\(\[Integral]\), \(0\), \(r\)]\(\((
\*SubsuperscriptBox[\(\[Integral]\), \(0\), \(2  \[Pi]\)]\((
\*SubsuperscriptBox[\(\[Integral]\), \(0\), \(2  \[Pi]\)]volumefactor \[DifferentialD]u)\) \[DifferentialD]v)\) \[DifferentialD]r\)\)
Out[62]=

Compare, using named properties in cataloged surfaces here:

In[63]:=
Entity["Surface", "Torus"]["SurfaceArea"][r, R]
Out[63]=
In[64]:=
Entity["Surface", "Torus"]["Volume"][r, R]
Out[64]=

Compute the geodesic of a toroid:

In[65]:=
t0 = 0; t1 = 208; (*curve paramters *)

geodesicParameters = Flatten@NDSolve[
   ResourceFunction["Geodesic"][
    Entity["Surface", "Torus"]["ParametricEquations"][1, 4][u, v], {u,
      v}, t, {0, 0}, 89 Degree], {u, v}, {t, t0, t1}]
Out[65]=

Plot the geodesic curve:

In[66]:=
geodesicCurve = Entity["Surface", "Torus"]["ParametricEquations"][1, 4][u[t], v[t]] /. geodesicParameters;
In[67]:=
Show[{ParametricPlot3D[
   Evaluate[
    Entity["Surface", "Torus"]["ParametricEquations"][1, 4][u, v]], {u, 0, 2 \[Pi]}, {v, 0, 2 \[Pi]}, PlotStyle -> Opacity[.5], Mesh -> False], ParametricPlot3D[geodesicCurve, {t, t0, t1}]}, Boxed -> False, Axes -> False, PlotRange -> All]
Out[67]=

Calculate the curve's length:

In[68]:=
NIntegrate[
 ResourceFunction["CoordinateMappingData"][geodesicCurve, "VolumeFactor", {t}], {t, t0, t1}]
Out[68]=

Define the normal vectors of a surface of revolution:

In[69]:=
mapping = {r[z] Cos[\[Phi]], r[z] Sin[\[Phi]], z}; coords = {\[Phi], z};

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

In[70]:=
shiftInverseConCov = Table[
    (ResourceFunction["CoordinateMappingData"][mapping, "ContravariantBaseVectors", coords][[\[Alpha]]]) .
     (ResourceFunction["CoordinateMappingData"][{x1, x2, x3}, "CovariantBaseVectors", {x1, x2, x3}][[i]]),
    {\[Alpha], 2}, {i, 3}] // Simplify;

The normal space :

In[71]:=
(normalVector = (1/
        2 (ResourceFunction[
           "EinsteinSummation"][{{i, j, k}, {\[Alpha], \[Beta]}, {\[Alpha], j}, {\[Beta], k}}, {\[Epsilon]ijk, \[Epsilon]\[Alpha]\[Beta], x\[Alpha]j, x\[Beta]k}]) /.
       {\[Epsilon]ijk -> ResourceFunction["CoordinateMappingData"][{x1, x2, x3}, "LeviCivitaContravariant", {x1, x2, x3}](*LeviCivitaTensor[
        3]*),
        \[Epsilon]\[Alpha]\[Beta] -> ResourceFunction["CoordinateMappingData"][mapping, "LeviCivitaCovariant", coords],
        x\[Alpha]j -> shiftInverseConCov,
        x\[Beta]k -> shiftInverseConCov} // Normal) // Simplify[#, {\[Phi] > 0, r[z] > 0}] &) // MatrixForm
Out[71]=

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

In[72]:=
SeedRandom[151];
n = 5;
list = Transpose[{Range[0, n - 1], RandomReal[{0.5, 2}, n]}];
ifun = Interpolation[list, InterpolationOrder -> 3];
Show[ListPlot@list, Plot[ifun[x], {x, 0, n}], PlotRange -> All, AxesLabel -> {"z", "r(z)"}]
Out[73]=
In[74]:=
surface = ParametricPlot3D[
   mapping /. r -> ifun, {\[Phi], 0, 2 \[Pi]}, {z, 0, 4}, PlotStyle -> Opacity[1], Mesh -> False];
In[75]:=
normals = ResourceFunction["PlotVector3D"][
   Flatten[
    Table[normalVector /. r -> ifun, {\[Phi], 0, 2 \[Pi], \[Pi]/
      15}, {z, 0, 4, 0.25}], 1],
   Flatten[
    Table[mapping /. r -> ifun, {\[Phi], 0, 2 \[Pi], \[Pi]/15}, {z, 0,
       4, 0.25}], 1],
   "ArrowSize" -> Small, "LocatedVector" -> False];
In[76]:=
Show[{surface, normals}, Boxed -> False, Axes -> False, PlotRange -> All]
Out[76]=

Properties and Relations (3) 

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

In[77]:=
mapping = {r Cos[\[Phi]], r Sin[\[Phi]], z}; coords = {r, \[Phi], z};
In[78]:=
ResourceFunction["CoordinateMappingData"][mapping, "MappingJacobian", coords] == D[mapping, {coords}] == Grad[mapping, coords] == CoordinateTransformData["Cylindrical" -> "Cartesian", "MappingJacobian", coords] == ResourceFunction["JacobianMatrix"][mapping, coords]
Out[78]=

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

In[79]:=
TrueQ[(ResourceFunction["CoordinateMappingData"][#[[1]], "MappingJacobian", #[[2]]] == Transpose@
       ResourceFunction["CoordinateMappingData"][#[[1]], "CovariantBaseVectors", #[[2]], "UnitVectors" -> False]) &[{{r Sin[u] Cos[v], r Sin[u] Sin[v],
      r Cos[u]}, {r, u, v}}] // Simplify]
Out[79]=
In[80]:=
TrueQ[(ResourceFunction["CoordinateMappingData"][#[[1]], "MappingJacobian", #[[2]]] == Transpose@
       ResourceFunction["CoordinateMappingData"][#[[1]], "CovariantBaseVectors", #[[2]], "UnitVectors" -> True]) &[{{r Sin[u] Cos[v], r Sin[u] Sin[v], r Cos[u]}, {r, u, v}}] // Simplify]
Out[80]=

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

In[81]:=
TrueQ[(ResourceFunction["CoordinateMappingData"][#[[1]], "InverseMappingJacobian", #[[2]]] == ResourceFunction["CoordinateMappingData"][#[[1]], "ContravariantBaseVectors", #[[2]], "UnitVectors" -> False]) &[{{r Sin[u] Cos[v], r Sin[u] Sin[v], r Cos[u]}, {r, u, v}}] // Simplify]
Out[81]=
In[82]:=
TrueQ[(ResourceFunction["CoordinateMappingData"][#[[1]], "InverseMappingJacobian", #[[2]]] == ResourceFunction["CoordinateMappingData"][#[[1]], "ContravariantBaseVectors", #[[2]], "UnitVectors" -> True]) &[{{r Sin[u] Cos[v], r Sin[u] Sin[v], r Cos[u]}, {r, u, v}}] // Simplify]
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]:=
ResourceFunction[
    "CoordinateMappingData"][{(R + r Cos[#[[2]]]) Cos[#[[1]]], (R + r Cos[#[[2]]]) Sin[#[[1]]], r Sin[#[[2]]]} &, "MappingJacobian"][{u, v}] // Simplify // MatrixForm
Out[83]=
In[84]:=
ResourceFunction[
  "CoordinateMappingData"][{(R + r Cos[#[[2]]]) Cos[#[[1]]], (R + r Cos[#[[2]]]) Sin[#[[1]]], r Sin[#[[2]]]} &, "MappingJacobianDeterminant"][{u, v}]
Out[84]=
In[85]:=
ResourceFunction[
  "CoordinateMappingData"][{(R + r Cos[#[[2]]]) Cos[#[[1]]], (R + r Cos[#[[2]]]) Sin[#[[1]]], r Sin[#[[2]]]} &, "InverseMappingJacobian"][{u, v}]
Out[85]=

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

In[86]:=
ResourceFunction[
   "CoordinateMappingData"][{(R + r Cos[#[[2]]]) Cos[#[[1]]], (R + r Cos[#[[2]]]) Sin[#[[1]]], r Sin[#[[2]]]} &, "ContravariantBaseVectors"][{u, v}] // Simplify
Out[86]=

Publisher

Lars Ulke-Winter

Version History

  • 1.0.0 – 22 March 2022

Source Metadata

Related Resources

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]:=
heart = {Sin[s2] (15 Sin[s1] - 4 Sin[3 s1]), 8 Cos[s2], Sin[s2] (15 Cos[s1] - 5 Cos[2 s1] - 2 Cos[3 s1] - Cos[2 s1])};
In[2]:=
shiftConCov = Table[
   (CoordinateMappingData[{x1, x2, x3}, "ContravariantBaseVectors", {x1, x2, x3}][[
      i]]) . (CoordinateMappingData[heart, "CovariantBaseVectors", {s1, s2}][[\[Alpha]]]),
   {i, 3}, {\[Alpha], 2}];
In[3]:=
Dimensions[shiftConCov]
In[4]:=
shiftConCov == CoordinateMappingData[heart, "MappingJacobian", {s1, s2}] // Simplify

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]:=
shiftInverseConCov = Table[
    (CoordinateMappingData[heart, "ContravariantBaseVectors", {s1, s2}][[\[Beta]]]) .
     (CoordinateMappingData[{x1, x2, x3}, "CovariantBaseVectors", {x1, x2, x3}][[i]]),
    {\[Beta], 2}, {i, 3}] // Simplify;
In[6]:=
Dimensions[shiftInverseConCov]

Confirm that the inverse relationship holds:

In[7]:=
shiftInverseConCov . shiftConCov // Simplify // MatrixForm

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]:=
Show[{ParametricPlot3D[heart, {s1, 0, 2 \[Pi]}, {s2, 0, \[Pi]}, PlotStyle -> {Red, Opacity[0.7]}, Mesh -> False],
  ParametricPlot3D[
   heart /. {s1 -> 4 u, s2 -> Sqrt[u]}, {u, 0, 2 \[Pi]}, PlotStyle -> Green]}, Boxed -> False, Axes -> False]

Generate the various shift tensors :

In[9]:=
xConiCov\[CapitalPhi] = CoordinateMappingData[heart /. {s1 -> 4 u, s2 -> Sqrt[u]}, "MappingJacobian", {u}];
xConiCov\[Alpha] = CoordinateMappingData[heart, "MappingJacobian", {s1, s2}];
sCon\[Alpha]Cov\[CapitalPhi] = CoordinateMappingData[{s1 /. {s1 -> 4 u}, s2 /. {s2 -> Sqrt[u]}}, "MappingJacobian", {u}];

Confirm :

In[10]:=
xConiCov\[CapitalPhi] == (xConiCov\[Alpha] /. {s1 -> 4 u, s2 -> Sqrt[u]}) . sCon\[Alpha]Cov\[CapitalPhi] // Simplify

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

In[11]:=
(ResourceFunction[
      "EinsteinSummation"][{{\[Beta], \[CapitalPsi]}, {\[CapitalPhi], \[CapitalPsi]}, {\[Alpha], \[Beta]}}, {s\[Beta]\[CapitalPsi], u\[CapitalPhi]\[CapitalPsi], s\[Alpha]\[Beta]}]) /.
   {s\[Beta]\[CapitalPsi] -> sCon\[Alpha]Cov\[CapitalPhi],
    u\[CapitalPhi]\[CapitalPsi] -> CoordinateMappingData[heart /. {s1 -> 4 u, s2 -> Sqrt[u]}, "InverseMetric", {u}],
    s\[Alpha]\[Beta] -> CoordinateMappingData[heart, "Metric", {s1, s2}] /. {s1 -> 4 u, s2 -> Sqrt[u]}} // Simplify;

Compare the connection according to the definition :

In[12]:=
Table[
   (CoordinateMappingData[heart /. {s1 -> 4 u, s2 -> Sqrt[u]}, "ContravariantBaseVectors", {u}][[\[CapitalPhi]]]) . (CoordinateMappingData[heart, "CovariantBaseVectors", {s1, s2}][[\[Alpha]]]),
   {\[CapitalPhi], 1}, {\[Alpha], 2}] /. {s1 -> 4 u, s2 -> Sqrt[u]};
In[13]:=
(% == %%) // Simplify

License Information