X-Git-Url: https://scm.cri.mines-paristech.fr/git/linpy.git/blobdiff_plain/3d17926f6a9051fd4b3a2c19b756849103592bd9..2964ba35929f34ab12a6ee61ad7cc3fb543da875:/pypol/coordinates.py?ds=inline diff --git a/pypol/coordinates.py b/pypol/coordinates.py index eb8e78c..44b9e9d 100644 --- a/pypol/coordinates.py +++ b/pypol/coordinates.py @@ -133,30 +133,9 @@ class Vector(Coordinates): self._coordinates = terminal._map2(initial, operator.sub) return self - @property - def symbols(self): - return tuple(self._coordinates) - - @property - def dimension(self): - return len(self.symbols) - - def coordinates(self): - yield from self._coordinates.items() - - def coordinate(self, symbol): - if not isinstance(symbol, Symbol): - raise TypeError('symbol must be a Symbol instance') - return self._coordinates[symbol] - - __getitem__ = coordinate - def isnull(self): return not bool(self) - def __bool__(self): - return any(self._coordinates.values()) - def __add__(self, other): if isinstance(other, (Point, Vector)): coordinates = self._map2(other, operator.add) @@ -171,7 +150,7 @@ class Vector(Coordinates): """ if not isinstance(other, Vector): raise TypeError('argument must be a Vector instance') - cosinus = self.dot(other) / (self.norm() * other.norm()) + cosinus = self.dot(other) / (self.norm()*other.norm()) return math.acos(cosinus) def cross(self, other):