def cart2sph(x, y, z):
'''Converts cartesian coordinates x, y, z to spherical coordinates az, el, r.'''
hxy = _np.hypot(x, y)
r = _np.hypot(hxy, z)
el = _np.arctan2(z, hxy)
az = _np.arctan2(y, x)
return az, el, r
评论列表
文章目录