yt.utilities.math_utils.
compute_cylindrical_radius
(CoM, L, P, V)[source]¶Compute the radius for some data around an axis in cylindrical coordinates.
This is primarily for halo computations. Given some data, this computes the cylindrical radius for each point. This is accomplished by converting the reference frame of the center of mass of the halo.
Parameters: | CoM : array
L : array
P : array
V : array
|
---|---|
Returns: | cyl_r : array
|
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]])
>>> cyl_r = compute_cylindrical_radius(CoM, L, P, V)
>>> cyl_r
array([ 1. , 1.41421356, 0. , 1.41421356])