normalized_vectors

halotools.utils.normalized_vectors(vectors)[source] [edit on github]

Return a unit-vector for each 3d vector in the input list of 3d points.

Parameters:

x : ndarray

Numpy array of shape (npts, 3) storing a collection of 3d points

Returns:

normed_x : ndarray

Numpy array of shape (npts, 3)

Examples

>>> npts = int(1e3)
>>> x = np.random.random((npts, 3))
>>> normed_x = normalized_vectors(x)