Use our own hypot() for older Python support
This commit is contained in:
+2
-1
@@ -1,4 +1,5 @@
|
||||
import math
|
||||
from mosfet import utils
|
||||
|
||||
class Vector3D:
|
||||
def __init__(self, vector):
|
||||
@@ -17,7 +18,7 @@ class Vector3D:
|
||||
return self.tuple()[key]
|
||||
|
||||
def length(self):
|
||||
return math.hypot(self.x, self.y, self.z)
|
||||
return utils.hypot(self.x, self.y, self.z)
|
||||
|
||||
def normalized(self):
|
||||
x = self.x / self.length()
|
||||
|
||||
Reference in New Issue
Block a user