Added sub

This commit is contained in:
Thomas FORGIONE
2017-01-25 13:29:08 +01:00
parent 7836f327e0
commit 4d502eecac
+6
View File
@@ -29,6 +29,12 @@ class Vector:
"""
return Vector(self.x + other.x, self.y + other.y, self.z + other.z)
def __sub__(self, other):
"""
Subs two vectors
"""
return Vector(self.x - other.x, self.y - other.y, self.z - other.z)
def __mul__(self, other):
"""
Computes the product between a vector and a number