jpcad/Line.py
2011-03-31 19:38:06 -04:00

21 lines
466 B
Python

from Shape import Shape
class Line(Shape):
def __init__(self, x0, y0, x1, y1):
self.vars = [x0, y0, x1, y1]
def nVars(self):
return len(self.vars)
def nPts(self):
return 3
def toEqu(self, ptNum):
if ptNum == 0:
return ([1, 0, 0, 0], [0, 1, 0, 0])
elif ptNum == 1:
return ([0, 0, 1, 0], [0, 0, 0, 1])
elif ptNum == 2:
return ([0.5, 0, 0.5, 0], [0, 0.5, 0, 0.5])