Files
AutoControlSystem-G/Util/util_math.py
2025-07-29 13:16:30 +08:00

14 lines
273 B
Python

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