cart_to_sph#
- caput.astro.coordinates.spherical.cart_to_sph(cart_arr: numpy.typing.ArrayLike[numpy.integer | numpy.floating]) numpy.ndarray[numpy.floating][source]#
Convert a vector of Cartesian coordinates into spherical polar coordinates.
Uses the same convention as sph_to_cart.
- Parameters:
- cart_arrarray_like
Vector (or array) of cartesian coordinates.
- Returns:
- polar_vectorarray_like
Array of spherical polars (packed as [[ r1, theta1, phi1], [r2, theta2, phi2], …]