diff --git a/Circle.py b/Circle.py index f0c33d1..f0b18d1 100644 --- a/Circle.py +++ b/Circle.py @@ -1,3 +1,22 @@ class Circle(Shape): - pass + def __init__(self, x, y, r): + self.vars = [x, y, r] + + def nVars(self): + return len(self.vars) + + def nPts(self): + return 5 + + def toEqu(self, ptNum): + if ptNum == 0: + return ([1, 0, 0], [0, 1, 0]) + elif ptNum == 1: + return ([1, 0, 1], [0, 1, 0]) + elif ptNum == 2: + return ([1, 0, 0], [0, 1, 1]) + elif ptNum == 3: + return ([1, 0, -1], [0, 1, 0]) + elif ptNum == 4: + return ([1, 0, 0], [0, 1, -1]) diff --git a/Line.py b/Line.py index 0086ccb..b576365 100644 --- a/Line.py +++ b/Line.py @@ -1,7 +1,16 @@ class Line(Shape): def __init__(self, x0, y0, x1, y1): - self.x0 = x0 - self.y0 = y0 - self.x1 = x1 - self.y1 = 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])