17 lines
360 B
Python
17 lines
360 B
Python
|
|
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])
|