On 6/7/10 10:39 AM, dbjohn wrote:
Notice that William's pointA is just (1,1), whereas yours is
point((1,1)). The reason for the unusual error message is that
sage: line??
shows that if we get any error from trying to make a 2D line, it
assumes you want a 3D line.
Okay it works when I define a point with just the coordinates like you
said. So is the lesson that when you pass the two points to a line:
ensure that they are defined by just the coordinates otherwise it will
think you are trying to make a 3d line which it can't do.
But suppose I want the point to be of a certain color or size, I need
to use point() like: point((1,1),rgbcolor=hue(0.75),size=100)
And then pass to line() which won't work. I tried calling its
attributes separately like
pointA = (1,1)
pointA.size = 100.
Didn't work either.
I think the confusion here stems from the multiple meanings the word
"point" is being associated with.
(1,2) is just a tuple of two numbers, like the two x,y coordinates.
point((1,2)) is a graphic object in Sage. A picture.
So doing line(point((1,2)), point((3,4))) is like saying "make a line
from a picture to another picture", which Sage doesn't know how to do.
However, Sage does know how to make a line between x,y coordinates (1,2)
and x,y coordinates (3,4), so line((1,2), (3,4)) works fine.
So you might do something like:
p=(1,1)
q=(2,3)
point(p)+point(q)+line([p,q])
The first two lines give the coordinates, and then the third line
constructs three pictures from the coordinates and superimposes the
pictures.
Thanks,
Jason
--
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org