vectors_normal_to_planes

halotools.utils.vectors_normal_to_planes(x, y)[source] [edit on github]

Given a collection of 3d vectors x and y, return a collection of 3d unit-vectors that are orthogonal to x and y.

Parameters:
x : ndarray

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

Note that the normalization of x will be ignored.

y : ndarray

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

Note that the normalization of y will be ignored.

Returns:
z : ndarray

Numpy array of shape (npts, 3). Each 3d vector in z will be orthogonal to the corresponding vector in x and y.

Examples

Define a set of random 3D vectors

>>> npts = int(1e4)
>>> x = np.random.random((npts, 3))
>>> y = np.random.random((npts, 3))

now calculate a thrid set of vectors to a corresponding pair in x and y.

>>> normed_z = angles_between_list_of_vectors(x, y)