"""Imago geometry module"""
+from manual import line, intersection
+
class V(object):
def __init__(self, x, y):
self.x = x
return V(other * self.x, other * self.y)
def __len__(self):
- return 2;
+ return 2
def __getitem__(self, key):
if key == 0:
def normal(self):
return V(-self.y, self.x)
-def projection(point, line, vector):
- return V(*intersection(g_line(point, point + vector.normal), g_line(*line)))
+def projection(p, l, v):
+ return V(*intersection(line(p, p + v.normal), line(*l)))