Use our own hypot() for older Python support
This commit is contained in:
+5
-1
@@ -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])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user