Added sub
This commit is contained in:
parent
7836f327e0
commit
4d502eecac
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue