@@ -1147,13 +1147,25 @@ def dot_product(self, other, metric=None):
11471147 u.v: (0, 2*pi) --> R
11481148 t |--> sin(t)^2
11491149
1150+ Scalar product between a vector field along the curve and a vector
1151+ field on the ambient Euclidean plane::
1152+
1153+ sage: e_x = M.cartesian_frame()[1]
1154+ sage: s = u.dot_product(e_x); s
1155+ Scalar field u.e_x on the Real interval (0, 2*pi)
1156+ sage: s.display()
1157+ u.e_x: (0, 2*pi) --> R
1158+ t |--> cos(t)
1159+
11501160 """
11511161 default_metric = metric is None
11521162 if default_metric :
11531163 metric = self ._ambient_domain .metric ()
11541164 dest_map = self .parent ().destination_map ()
1155- if dest_map is not self . _domain . identity_map ():
1165+ if dest_map != metric . parent (). base_module (). destination_map ():
11561166 metric = metric .along (dest_map )
1167+ if dest_map != other .parent ().destination_map ():
1168+ other = other .along (dest_map )
11571169 resu = metric (self , other )
11581170 # From the above operation the name of resu is "g(u,v')" where
11591171 # g = metric._name, u = self._name, v = other._name
@@ -1248,7 +1260,7 @@ def norm(self, metric=None):
12481260 if default_metric :
12491261 metric = self ._ambient_domain .metric ()
12501262 dest_map = self .parent ().destination_map ()
1251- if dest_map is not self . _domain . identity_map ():
1263+ if dest_map != metric . parent (). base_module (). destination_map ():
12521264 metric = metric .along (dest_map )
12531265 resu = metric (self , self ).sqrt ()
12541266 if self ._name is not None :
@@ -1357,6 +1369,16 @@ def cross_product(self, other, metric=None):
13571369 sage: w.display()
13581370 -sin(t) e_x - cos(t) e_y + (2*cos(t)^2 - 1) e_z
13591371
1372+ Cross product between a vector field along the curve and a vector field
1373+ on the ambient Euclidean space::
1374+
1375+ sage: e_x = M.cartesian_frame()[1]
1376+ sage: w = u.cross_product(e_x); w
1377+ Vector field C' x e_x along the Real interval (0, 2*pi) with values
1378+ on the Euclidean space E^3
1379+ sage: w.display()
1380+ C' x e_x = e_y - cos(t) e_z
1381+
13601382 """
13611383 if self ._ambient_domain .dim () != 3 :
13621384 raise ValueError ("the cross product is not defined in dimension " +
@@ -1365,10 +1387,12 @@ def cross_product(self, other, metric=None):
13651387 if default_metric :
13661388 metric = self ._ambient_domain .metric ()
13671389 dest_map = self .parent ().destination_map ()
1368- if dest_map is self . _domain . identity_map ():
1390+ if dest_map == metric . parent (). base_module (). destination_map ():
13691391 eps = metric .volume_form (1 )
13701392 else :
13711393 eps = metric .volume_form (1 ).along (dest_map )
1394+ if dest_map != other .parent ().destination_map ():
1395+ other = other .along (dest_map )
13721396 resu = eps .contract (1 , 2 , self .wedge (other ), 0 , 1 ) / 2
13731397 # The result is named "u x v" only for a default metric:
13741398 if (default_metric and self ._name is not None and
0 commit comments