Added sub

This commit is contained in:
Thomas FORGIONE 2017-01-25 13:29:08 +01:00
parent 7836f327e0
commit 4d502eecac
No known key found for this signature in database
GPG Key ID: 2A210FFC062E00C3
1 changed files with 6 additions and 0 deletions

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