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
+5 -1
View File
@@ -1,12 +1,16 @@
import importlib
import collections
from math import floor, ceil, sqrt, hypot
from math import floor, ceil, sqrt
from mosfet.info import blocks
from mosfet.info import mcdata
TICK = 0.05
def hypot(*coordinates):
# python's 3D hypot is too new, so we'll use our own
return sqrt(sum(x**2 for x in coordinates))
def padd(p1, p2):
return (p1[0] + p2[0], p1[1] + p2[1], p1[2] + p2[2])