4141 Open subset U of the 3-dimensional topological manifold R^3
4242 sage: c_spher(p)
4343 (1, 1/2*pi, pi)
44- sage: p.coord (c_spher) # equivalent to above
44+ sage: p.coordinates (c_spher) # equivalent to above
4545 (1, 1/2*pi, pi)
4646
4747Computing the coordinates of ``p`` in a new chart::
@@ -108,7 +108,7 @@ class ManifoldPoint(Element):
108108 sage: (a, b) = var('a b') # generic coordinates for the point
109109 sage: p = M.point((a, b), name='P'); p
110110 Point P on the 2-dimensional topological manifold M
111- sage: p.coord () # coordinates of P in the subset's default chart
111+ sage: p.coordinates () # coordinates of P in the subset's default chart
112112 (a, b)
113113
114114 Since points are Sage *elements*, the *parent* of which being the
@@ -245,16 +245,16 @@ def _latex_(self):
245245 return r'\mbox{' + str (self ) + r'}'
246246 return self ._latex_name
247247
248- def coord (self , chart = None , old_chart = None ):
248+ def coordinates (self , chart = None , old_chart = None ):
249249 r"""
250250 Return the point coordinates in the specified chart.
251251
252252 If these coordinates are not already known, they are computed from
253253 known ones by means of change-of-chart formulas.
254254
255255 An equivalent way to get the coordinates of a point is to let the
256- chart acting of the point, i.e. if ``X`` is a chart and ``p`` a
257- point, one has ``p.coord (chart=X) == X(p)``.
256+ chart acting on the point, i.e. if ``X`` is a chart and ``p`` a
257+ point, one has ``p.coordinates (chart=X) == X(p)``.
258258
259259 INPUT:
260260
@@ -273,14 +273,13 @@ def coord(self, chart=None, old_chart=None):
273273 sage: M = Manifold(3, 'M', structure='topological')
274274 sage: c_spher.<r,th,ph> = M.chart(r'r:(0,+oo) th:(0,pi):\theta ph:(0,2*pi):\phi') # spherical coordinates
275275 sage: p = M.point((1, pi/2, pi))
276- sage: p.coord () # coordinates on the manifold's default chart
276+ sage: p.coordinates () # coordinates in the manifold's default chart
277277 (1, 1/2*pi, pi)
278278
279- We now give ``p`` in the coordinates of the chart ``c_spher``
280- explicitly specified. However this is same result as above
281- since this is the default chart)::
279+ Since the default chart of ``M`` is ``c_spher``, it is equivalent to
280+ write::
282281
283- sage: p.coord (c_spher)
282+ sage: p.coordinates (c_spher)
284283 (1, 1/2*pi, pi)
285284
286285 An alternative way to get the coordinates is to let the chart act
@@ -289,6 +288,11 @@ def coord(self, chart=None, old_chart=None):
289288 sage: c_spher(p)
290289 (1, 1/2*pi, pi)
291290
291+ A shortcut for ``coordinates`` is ``coord``::
292+
293+ sage: p.coord()
294+ (1, 1/2*pi, pi)
295+
292296 Computing the Cartesian coordinates from the spherical ones::
293297
294298 sage: c_cart.<x,y,z> = M.chart() # Cartesian coordinates
@@ -327,7 +331,7 @@ def coord(self, chart=None, old_chart=None):
327331
328332 sage: c_wz.<w,z> = M.chart()
329333 sage: ch_uv_wz = c_uv.transition_map(c_wz, [u^3, v^3])
330- sage: p .coord(c_wz, old_chart=c_uv)
334+ sage: P .coord(c_wz, old_chart=c_uv)
331335 (a^3 - 3*a^2*b + 3*a*b^2 - b^3, a^3 + 3*a^2*b + 3*a*b^2 + b^3)
332336
333337 Actually, in the present case, it is not necessary to specify
@@ -409,7 +413,9 @@ def coord(self, chart=None, old_chart=None):
409413 self ._coordinates [chart ] = chcoord (* self ._coordinates [old_chart ])
410414 return self ._coordinates [chart ]
411415
412- def set_coord (self , coords , chart = None ):
416+ coord = coordinates
417+
418+ def set_coordinates (self , coords , chart = None ):
413419 r"""
414420 Sets the point coordinates in the specified chart.
415421
@@ -432,21 +438,27 @@ def set_coord(self, coords, chart=None):
432438 sage: X.<x,y> = M.chart()
433439 sage: p = M.point()
434440
435- We set the coordinates on the manifold's default chart::
441+ We set the coordinates in the manifold's default chart::
436442
437- sage: p.set_coord ((2,-3))
438- sage: p.coord ()
443+ sage: p.set_coordinates ((2,-3))
444+ sage: p.coordinates ()
439445 (2, -3)
440446 sage: X(p)
441447 (2, -3)
442448
449+ A shortcut for ``set_coordinates`` is ``set_coord``::
450+
451+ sage: p.set_coord((2,-3))
452+ sage: p.coord()
453+ (2, -3)
454+
443455 Let us introduce a second chart on the manifold::
444456
445457 sage: Y.<u,v> = M.chart()
446458 sage: X_to_Y = X.transition_map(Y, [x+y, x-y])
447459
448- If we set the coordinates of ``p`` in the chart ``Y``, those
449- in the chart ``X`` are lost::
460+ If we set the coordinates of ``p`` in chart ``Y``, those in chart ``X``
461+ are lost::
450462
451463 sage: Y(p)
452464 (-1, 5)
@@ -458,7 +470,9 @@ def set_coord(self, coords, chart=None):
458470 self ._coordinates .clear ()
459471 self .add_coord (coords , chart )
460472
461- def add_coord (self , coords , chart = None ):
473+ set_coord = set_coordinates
474+
475+ def add_coordinates (self , coords , chart = None ):
462476 r"""
463477 Adds some coordinates in the specified chart.
464478
@@ -486,30 +500,36 @@ def add_coord(self, coords, chart=None):
486500 sage: X.<x,y> = M.chart()
487501 sage: p = M.point()
488502
489- We give the point the coordinates on the manifold's default chart::
503+ We give the point some coordinates in the manifold's default chart::
490504
491- sage: p.add_coord ((2,-3))
492- sage: p.coord ()
505+ sage: p.add_coordinates ((2,-3))
506+ sage: p.coordinates ()
493507 (2, -3)
494508 sage: X(p)
495509 (2, -3)
496510
511+ A shortcut for ``add_coordinates`` is ``add_coord``::
512+
513+ sage: p.add_coord((2,-3))
514+ sage: p.coord()
515+ (2, -3)
516+
497517 Let us introduce a second chart on the manifold::
498518
499519 sage: Y.<u,v> = M.chart()
500520 sage: X_to_Y = X.transition_map(Y, [x+y, x-y])
501521
502- If we add the coordinates of p in the chart Y , those in the chart X
522+ If we add coordinates for ``p`` in chart ``Y`` , those in chart ``X``
503523 are kept::
504524
505- sage: p.add_coord ((-1,5), chart=Y)
525+ sage: p.add_coordinates ((-1,5), chart=Y)
506526 sage: p._coordinates # random (dictionary output)
507527 {Chart (M, (u, v)): (-1, 5), Chart (M, (x, y)): (2, -3)}
508528
509- On the contrary, with the method :meth:`set_coord `, the coordinates
510- in charts different from Y would be lost::
529+ On the contrary, with the method :meth:`set_coordinates `, the
530+ coordinates in charts different from ``Y`` would be lost::
511531
512- sage: p.set_coord ((-1,5), chart=Y)
532+ sage: p.set_coordinates ((-1,5), chart=Y)
513533 sage: p._coordinates
514534 {Chart (M, (u, v)): (-1, 5)}
515535
@@ -525,6 +545,8 @@ def add_coord(self, coords, chart=None):
525545 "defined on the {}" .format (self .parent ()))
526546 self ._coordinates [chart ] = coords
527547
548+ add_coord = add_coordinates
549+
528550 def __eq__ (self , other ):
529551 r"""
530552 Compares the current point with another one.
@@ -594,7 +616,7 @@ def __eq__(self, other):
594616 # transformation:
595617 for chart in self ._coordinates :
596618 try :
597- other .coord (chart )
619+ other .coordinates (chart )
598620 common_chart = chart
599621 break
600622 except ValueError :
@@ -603,7 +625,7 @@ def __eq__(self, other):
603625 # Attempt a coordinate transformation in the reverse way:
604626 for chart in other ._coordinates :
605627 try :
606- self .coord (chart )
628+ self .coordinates (chart )
607629 common_chart = chart
608630 break
609631 except ValueError :
0 commit comments