yt.utilities.math_utils.euclidean_dist

yt.utilities.math_utils.euclidean_dist(a, b)[source]

Find the Euclidean distance between two points.

Parameters:

a : array or list

Either an ndim long list of coordinates corresponding to a single point or an (ndim, npoints) list of coordinates for many points in space.

b : array or list

Either an ndim long list of coordinates corresponding to a single point or an (ndim, npoints) list of coordinates for many points in space.

Examples

>>> a = [0.1, 0.1, 0.1]
>>> b = [0.9, 0,9, 0.9]
>>> period = 1.
>>> dist = euclidean_dist(a, b)
>>> dist
1.38564064606