I have code that defines a line segment as a point and a vector. So
for line pq, I compute point q from l.p and l.v when necessary. I
also
refer to x and y coords eg. (p.x+q.x, p.y+q.y) So I've wrapped line2d
and point2d from sage using them as __repr__ in my new class and I'm
wondering if this is going to work and if it will impact performance.
class Line2:
__slots__ = ['p', 'v']
def __init__(self, p, v):
self.p = p
self.v = v
def __repr__(self):
return line2d([self.p, (self.p+self.v)], thickness=1,
color="black")
--
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