Vertex now uses true division instead of casting RHS to float

- updated tests
This commit is contained in:
Stephen M. McQuay
2012-03-22 10:09:14 -06:00
parent c1f7ee46bc
commit a4d9129d77
2 changed files with 11 additions and 3 deletions
+2 -1
View File
@@ -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)