extracting info from diff_map definition

I've defined the following diff_map

R2 = Manifold(2, 'R2', start_index=1, latex_name=r'\mathbb{R}^2')
cartesian2d.<x, y> = R2.chart()
R1 = Manifold(1, 'R1', start_index=1, latex_name=r'\mathbb{R}^1')
cartesian1d.<t> = R1.chart()
h = R1.diff_map(R2, [1-t, sqrt(2*t-t^2)])
h.display()


I would like to extract the elements of the diff_map, namely 1-t and sqrt(2*t-t^2) for propose of plotting the resulting curve or for other manipulations. How can I do that?

Thanks,

Daniel

edit retag close merge delete

Sort by ยป oldest newest most voted

Given the Sage object h you can see which methods apply to it, with the tab completion:

sage: h.<TAB>


You will see that there is an expression method:

sage: h.expression()
(-t + 1, sqrt(-t^2 + 2*t))


This is a tuple, and you can get its entrie as follows:

sage: h.expression()[0]
-t + 1
sage: h.expression()[1]
sqrt(-t^2 + 2*t)

more

By the same method I also found h.coord_functions()[0]

Thanks!

( 2018-03-08 04:03:33 -0500 )edit