Components of Points

9 views
Skip to first unread message

raman kurdi

unread,
May 12, 2012, 3:54:35 PM5/12/12
to sage-s...@googlegroups.com
Hi,
I need a command which separate the components of points. For example
let P=(2,4).
I need the first component of this point.
Could you please help me?

Johan Grönqvist

unread,
May 12, 2012, 4:01:11 PM5/12/12
to sage-s...@googlegroups.com
sage: P=(2,4)
sage: P[0]
2
sage: P[1]
4



/ johan

kcrisman

unread,
May 12, 2012, 9:59:33 PM5/12/12
to sage-s...@googlegroups.com
Just to make it clear, you are really taking items from a "Python tuple".  If you are talking about actual "points" in the graphical sense, you'd need to do something else.

sage: P = point((2,3))
sage: p = P[0]
sage: p.xdata
[2.0]
 
Reply all
Reply to author
Forward
0 new messages