Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_distance(self):
p1 = np.array([2, 5, 3], dtype=np.float32)
p2 = np.array([3, 9, -2], dtype=np.float32)
d = distance(p1, p2)
self.assertAlmostEqual(d, 6.4807405)
def _dist(self, obj1: Object, obj2: Object) -> float:
p1 = obj1._model_matrix[3]
p2 = obj2._model_matrix[3]
return distance(p1, p2)