# Revision history [back]

In EuclideanSpace, there are three predefined coordinate charts, which are returned by the methods cartesian_coordinates(), spherical_coordinates() and cylindrical_coordinates():

sage: E.<x,y,z> = EuclideanSpace()
sage: E.cartesian_coordinates()
Chart (E^3, (x, y, z))
sage: E.spherical_coordinates()
Chart (E^3, (r, th, ph))
sage: E.cylindrical_coordinates()
Chart (E^3, (rh, ph, z))


But you can define as many charts as you want by means of the method chart(). For instance:

sage: Cartes1.<x1, y1, z1> = E.chart()
sage: Cartes1
Chart (E^3, (x1, y1, z1))


To complete the construction, you have to specify the transition map from previously defined coordinates:

sage: Cartes_to_Cartes1 = E.cartesian_coordinates().transition_map(Cartes1, [x-2, y+3, z])
sage: Cartes_to_Cartes1.display()
x1 = x - 2
y1 = y + 3
z1 = z


as well as its inverse, either by asking Sage to compute it (method inverse()) or by specifying it by hand (method set_inverse():

sage: Cartes_to_Cartes1.inverse().display()
x = x1 + 2
y = y1 - 3
z = z1


Then Sage can compute vector field components in the new coordinate frame:

sage: v = E.vector_field(x+z, y*z, x*y)
sage: v.display()
(x + z) e_x + y*z e_y + x*y e_z
sage: v.display(Cartes1)
(x1 + z1 + 2) d/dx1 + (y1 - 3)*z1 d/dy1 + ((x1 + 2)*y1 - 3*x1 - 6) d/dz1


For more details, see the coordinate chart documentation.

In EuclideanSpace, there are three predefined coordinate charts, which are returned by the methods cartesian_coordinates(), spherical_coordinates() and cylindrical_coordinates():

sage: E.<x,y,z> = EuclideanSpace()
sage: E.cartesian_coordinates()
Chart (E^3, (x, y, z))
sage: E.spherical_coordinates()
Chart (E^3, (r, th, ph))
sage: E.cylindrical_coordinates()
Chart (E^3, (rh, ph, z))


But you can define as many charts as you want by means of the method chart(). For instance:

sage: Cartes1.<x1, y1, z1> = E.chart()
sage: Cartes1
Chart (E^3, (x1, y1, z1))


To complete the construction, you have to specify the transition map from previously defined coordinates:

sage: Cartes_to_Cartes1 = E.cartesian_coordinates().transition_map(Cartes1, [x-2, y+3, z])
sage: Cartes_to_Cartes1.display()
x1 = x - 2
y1 = y + 3
z1 = z


as well as its inverse, either by asking Sage to compute it (method inverse()) or by specifying it by hand (method set_inverse():):

sage: Cartes_to_Cartes1.inverse().display()
x = x1 + 2
y = y1 - 3
z = z1


Then Sage can compute vector field components in the new coordinate frame:

sage: v = E.vector_field(x+z, y*z, x*y)
sage: v.display()
(x + z) e_x + y*z e_y + x*y e_z
sage: v.display(Cartes1)
(x1 + z1 + 2) d/dx1 + (y1 - 3)*z1 d/dy1 + ((x1 + 2)*y1 - 3*x1 - 6) d/dz1


For more details, see the coordinate chart documentation.