Use our own hypot() for older Python support

This commit is contained in:
2021-04-28 07:12:30 +00:00
parent af9cc4b546
commit aec057c89c
23 changed files with 28 additions and 28 deletions
+2 -1
View File
@@ -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()