Vertex now uses true division instead of casting RHS to float
- updated tests
This commit is contained in:
+2
-1
@@ -1,3 +1,4 @@
|
||||
from __future__ import division
|
||||
import pprint
|
||||
|
||||
'''
|
||||
@@ -66,8 +67,8 @@ class Vertex(object):
|
||||
|
||||
def __div__(self, other):
|
||||
# same assumption as __mult__
|
||||
other = float(other)
|
||||
return Vertex(self.x / other, self.y / other, self.z / other)
|
||||
__truediv__ = __div__
|
||||
|
||||
def __neg__(self):
|
||||
return Vertex(-self.x, -self.y, -self.z)
|
||||
|
||||
Reference in New Issue
Block a user