cart_to_sphere#

pycraf.geometry.cart_to_sphere(x, y, z, broadcast_arrays=True)[source]#

Spherical coordinates from Cartesian representation.

Parameters:
x, y, zQuantity

Cartesian position [m]

Returns:
rQuantity

Radial distance [m]

phiQuantity

Azimuth [deg]

thetaQuantity

Elevation [deg]

broadcast_arraysbool, optional

If ‘True’, output arrays will be broadcasted to dense matrices, otherwise the returned arrays will be a sparse representation (default: True)

Notes

Unlike with the mathematical definition, theta is not the angle to the (positive) z axis, but the elevation above the x-y plane.