MCPcopy Create free account
hub / github.com/OpenDriveLab/DriveAdapter / compute_distance

Function compute_distance

agents/tools/misc.py:144–154  ·  view source on GitHub ↗

Euclidean distance between 3D points :param location_1, location_2: 3D points

(location_1, location_2)

Source from the content-addressed store, hash-verified

142
143
144def compute_distance(location_1, location_2):
145 """
146 Euclidean distance between 3D points
147
148 :param location_1, location_2: 3D points
149 """
150 x = location_2.x - location_1.x
151 y = location_2.y - location_1.y
152 z = location_2.z - location_1.z
153 norm = np.linalg.norm([x, y, z]) + np.finfo(float).eps
154 return norm
155
156
157def positive(num):

Callers 1

_bh_is_vehicle_hazardMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected