yt.utilities.math_utils.compute_rotational_velocity

yt.utilities.math_utils.compute_rotational_velocity(CoM, L, P, V)[source]

Computes the rotational velocity for some data around an axis.

This is primarily for halo computations. Given some data, this computes the circular rotational velocity of each point (particle) in reference to the axis defined by the angular momentum vector. This is accomplished by converting the reference frame of the center of mass of the halo.

Parameters:

CoM : array

The center of mass in 3D.

L : array

The angular momentum vector.

P : array

The positions of the data to be modified (i.e. particle or grid cell postions). The array should be Nx3.

V : array

The velocities of the data to be modified (i.e. particle or grid cell velocities). The array should be Nx3.

Returns:

v : array

An array N elements long that gives the circular rotational velocity for each datum (particle).

Examples

>>> CoM = np.array([0, 0, 0])
>>> L = np.array([0, 0, 1])
>>> P = np.array([[1, 0, 0], [1, 1, 1], [0, 0, 1], [1, 1, 0]])
>>> V = np.array([[0, 1, 10], [-1, -1, -1], [1, 1, 1], [1, -1, -1]])
>>> circV = compute_rotational_velocity(CoM, L, P, V)
>>> circV
array([ 1.        ,  0.        ,  0.        ,  1.41421356])