pose_format.utils.fast_math module
Functions:
|
Computes Euclidean distance between two sets of points in batch |
- pose_format.utils.fast_math.distance_batch(p1s, p2s)[source]
Computes Euclidean distance between two sets of points in batch
- Parameters:
p1s (array-like) – array of shape (N, D) where N; number of points & D ; dimensionality of each point
p2s (array-like) – array of shape (N, D) with N; number of points & D; dimensionality of each point
- Returns:
array of shape (N,) with euclidean distances between points in
p1sandp2s- Return type:
array-like
Examples
>>> distance_batch(np.array([[0, 0], [1, 1]]), np.array([[1, 1], [2, 2]])) array([1.41421356, 1.41421356])
Note
Function assumes that the inputs
p1sandp2shave the same shape