first commit
This commit is contained in:
14
Util/util_math.py
Normal file
14
Util/util_math.py
Normal file
@ -0,0 +1,14 @@
|
||||
import math
|
||||
|
||||
|
||||
def get_distance(p1, p2):
|
||||
"""
|
||||
计算两点间的距离
|
||||
:param p1:
|
||||
:param p2:
|
||||
:return:
|
||||
"""
|
||||
return math.sqrt((p1.X - p2.X) ** 2 + (p1.Y - p2.Y) ** 2+ (p1.Z - p2.Z)**2)
|
||||
|
||||
def is_bit_set(n, position):
|
||||
return (n >> position) & 1 == 1
|
||||
Reference in New Issue
Block a user